I need to be able to run a script VB or PowerShell (PS preferred) to look up a AD user accounts SID, search for that SID in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList and remove that entry.
Is this possible? I have the easy part of the script written, it looks up the SID and stores it but the search of the registry is what I need help with:
Import-Module ActiveDirectory
$UserName = Read-Host "What is the User Name?"
$UserNameSID = Get-ADUser -Identity "$UserName" | Format-List *SID*