Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Perform action on every user in a domain EXCEPT those in a certain OU

$
0
0

We're having issues with our TSProfilePath attribute, and after a long search it looks like an old user creation script was populating it with bad data. My boss has asked me to wipe that attribute from every single AD user in our tree except those in a specific OU that have manually created accounts.

The command is:

set-qaduser $user -TsProfilePath "`0"

(I'm using the Quest AD tools because the MicroSoft ones can't access the TSProfilePath attribute without going through ADSI, which would add about a dozen lines to what should otherwise be a simple script)

How do I go about doing that for every user in the tree except for ones in the "user secured" OU? 

Thanks


zarberg@gmail.com


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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