Inconsistency In Microsoft Recommendations Regarding Powershell $Profile
Microsoft’s left hand apparently does not know what it’s right is doing, so I am writing a script that automates the correct setup of Powershell $profiles on a clean Windows install.
PowerShell Removing Profiles (registry, profile folder, and local account)
I am looking to remove all unused local accounts on all of our computers (400+/-.) I have a script that works for the basic part of removing the 2 local accounts that I’m mainly targeting, but I want to ensure it keeps all domain accounts. Is there a way to add a wildcard to the $AccountsToKeep line that would keep all domain accounts without typing each in? I tried ‘DOMAIN*’ but that didn’t seem to work.