Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Cleaning up corrupted profiles in Windows 2008 R2

$
0
0

I am building a script for us to run on a monthly basis that will search the ProfileList key in the Registry for .Bak at the end of the users SID, and when found, then delete the key. There are a few other pieces to the script which I have a handle on. 

The piece that is stumping me is that when I run the below in Posh, I am not able to find a SID with a .BAK on the end, (even though I am able to find this in the Gui of Regedit). What am I missing?

1.  Get-WmiObject-ComputerName'servername'-ClassWin32_UserProfile

 

 

 

2. $ProfileList="HKLM:\Software\Microsoft\Windows NT\CurrentVersion\ProfileList"
  
gci$ProfileList | format-List*

Thanks in advance.

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles