Suliman Abu Kharroub
asked on
Script to find all enabled users accounts inside AD doamin
Hello Dears,
I need a scrip to find all enabled user accounts located in an Active directory domain.
Could someone help please ?
Thanks In advance!
I need a scrip to find all enabled user accounts located in an Active directory domain.
Could someone help please ?
Thanks In advance!
Hello,
I use powershell for querying AD and the quest activeroles management shell. free download from:
http://www.quest.com/powershell/activeroles-server.aspx
Then you get AD specific commandlets.
the one below should give you all enabled users:
Get-QADUser -Enabled -SizeLimit 0
I use powershell for querying AD and the quest activeroles management shell. free download from:
http://www.quest.com/powershell/activeroles-server.aspx
Then you get AD specific commandlets.
the one below should give you all enabled users:
Get-QADUser -Enabled -SizeLimit 0
both methods given are good
I like using a great tool called adfind by Joe Richards
http://www.joeware.net/freetools/tools/adfind/index.htm
adfind -default -bit -f "&(objectcategory=person)( objectclas s=user)(!u serAccount Control:AN D:=2)" samaccountname displayname -csv > c:\EnabledUsers.csv
if you want disabled just run the same query but remove the ! before useraccountcontrol
That will give you a csv file on your C drive with all enabled users.
Thanks
Mike
I like using a great tool called adfind by Joe Richards
http://www.joeware.net/freetools/tools/adfind/index.htm
adfind -default -bit -f "&(objectcategory=person)(
if you want disabled just run the same query but remove the ! before useraccountcontrol
That will give you a csv file on your C drive with all enabled users.
Thanks
Mike
ASKER
Thanks all, sorry for the late reply. I was on vacation.
i will test and post back here.
i will test and post back here.
ASKER
Thanks again.
@iSiek:
"dsget failed:Directory object not found" returned error.
the text file shows result but it is not complete.
@Jhonnyla: It give a correct info, but the result is shown all in a single column event when i run :Get-QADUser -Enabled -SizeLimit 0 >c:\test.csv
can i export the result on excel file in three columns?
@mkline71:
"ldap_get_next_page_s: [DC-FQDN] Error 0x57 (87) - Filter Error" returned error
@iSiek:
"dsget failed:Directory object not found" returned error.
the text file shows result but it is not complete.
@Jhonnyla: It give a correct info, but the result is shown all in a single column event when i run :Get-QADUser -Enabled -SizeLimit 0 >c:\test.csv
can i export the result on excel file in three columns?
@mkline71:
"ldap_get_next_page_s: [DC-FQDN] Error 0x57 (87) - Filter Error" returned error
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dsquery user -name * -limit 0| dsget user -fn -ln -samid -email -desc -disabled >c:\users.txt
Import text file into excel and filter it for "no" in disabled column.