Class: Puppet::Util::ADSI::UserProfile
- Defined in:
- lib/vendor/puppet/util/adsi.rb
Class Method Summary collapse
Class Method Details
.delete(sid) ⇒ Object
190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/vendor/puppet/util/adsi.rb', line 190 def self.delete(sid) begin Puppet::Util::ADSI.wmi_connection.Delete("Win32_UserProfile.SID='#{sid}'") rescue => e # http://social.technet.microsoft.com/Forums/en/ITCG/thread/0f190051-ac96-4bf1-a47f-6b864bfacee5 # Prior to Vista SP1, there's no builtin way to programmatically # delete user profiles (except for delprof.exe). So try to delete # but warn if we fail raise e unless e..include?('80041010') Puppet.warning "Cannot delete user profile for '#{sid}' prior to Vista SP1" end end |