class Puppet::Util::Windows::ADSI::UserProfile

Public Class Methods

delete(sid) click to toggle source
    # File lib/puppet/util/windows/adsi.rb
571 def self.delete(sid)
572   begin
573     Puppet::Util::Windows::ADSI.wmi_connection.Delete("Win32_UserProfile.SID='#{sid}'")
574   rescue WIN32OLERuntimeError => e
575     # https://social.technet.microsoft.com/Forums/en/ITCG/thread/0f190051-ac96-4bf1-a47f-6b864bfacee5
576     # Prior to Vista SP1, there's no built-in way to programmatically
577     # delete user profiles (except for delprof.exe). So try to delete
578     # but warn if we fail
579     raise e unless e.message.include?('80041010')
580 
581     Puppet.warning _("Cannot delete user profile for '%{sid}' prior to Vista SP1") % { sid: sid }
582   end
583 end