Search for users 'Log on to' rights

There were some users that were created in active directory with the improper 'Log on to' permission (under the account tab in users). I would like to go through and check all users to ensure they have the proper permissions. Is there a simple way to do this without opening each user and checking under the 'Log on to' button?

I am looking for all users to have 'Log on to' rights for 'Server1' and 'Server2'.
Who is Participating?
Mike KlineCommented:
I like using adfind by MVP Joe Richards for things like this
userworkstations is the key attribute here
If you want to dump the attribute for all users use
adfind -default -f "&(objectcategory=person)(objectclass=user)" samaccountname userworkstations -csv  > c:\users.csv
if you want to just find users who have server1 and server2 set
adfind -default -f "&(objectcategory=person)(objectclass=user)(userworkstations=server1)(userworkstations=server2)" samaccountname userworkstations -csv  > c:\usersServers.csv
In my examples I've sent the output to a CSV file on the C drive.
Let me know if that works ok.
menreeqAuthor Commented:
perfect, saved me lots of time
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.