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