[Last Call] Learn how to a build a cloud-first strategyRegister Now


Search for users 'Log on to' rights

Posted on 2009-12-23
Medium Priority
Last Modified: 2013-12-04
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'.
Question by:menreeq
LVL 57

Accepted Solution

Mike Kline earned 2000 total points
ID: 26114914
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.

Author Closing Comment

ID: 31669563
perfect, saved me lots of time

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's recap what we learned from yesterday's Skyport Systems webinar.
A bad practice commonly found during an account life cycle is to set its password to an initial, insecure password. The Password Reset Tool was developed to make the password reset process easier and more secure.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question