Is it possible to find all the users profiles that are not on a certain server/folder using powershell and regular expressions? If so how would one go about this?
Tell me more
×
Server Fault is a question and answer site for
professional system and network administrators. It's 100% free, no registration required.
|
In powershell, use the Win32_UserProfile WMI Object to find profiles remotely:
To find user profiles not on a server (or that are, either way), you could do something like:
If the path exists, it will give results if not then it won't. You can do fancier stuff than this, but basically this should accomplish what you need without using regular expressions. |
|||
|
|
|
Funny, I just had to do this today. Try this script, replacing
|
|||
|
|
|
It's more efficient if you make the not match condition part of the LDAP query
|
||||
|
|