Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Script to look up user's SID and then delete entry from registry \ProfileList

$
0
0

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*


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>