Link to home
Start Free TrialLog in
Avatar of rakkad
rakkadFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Generate a list of AD Users

I need a powershell script written that will produce a list of AD users and if they have a connect drive present in the user's profile tab

I would like the list to be written to an excel spreadsheet
Avatar of athomsfere
athomsfere
Flag of United States of America image

Do you need to sort by container? Or for the entire domain?
ASKER CERTIFIED SOLUTION
Avatar of barrykfl
barrykfl
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Are you using native powershell or quest cmdlets?

I tested using the free adfind   http://www.joeware.net/freetools/tools/adfind/index.htm

adfind -default -f "&(objectcategory=person)(objectclass=user)(homedirectory=*)" samaccountname homedirectory -csv >  Users.csv

That will give you users that have the homedirectory populated.

Thanks

Mike
A real simple one would also be:

Get-QADUser * | Select-Object Name, HomeDirectory | Export-Csv "C:\Users\aufrench\Desktop\ADDUMP.CSV"

Open in new window


Assuming you use Quest's tools. However, depending on how large your domain is this might be a bad approach. A few hundred users  is no problem, but 10s of thousands and this might not work well on your PC.
Avatar of rakkad

ASKER

I do not have Quest's tools.  What do I need to do for this?
Love these cmdlets myself. Download them here... Quest PoSh cmdlets
Avatar of rakkad

ASKER

This helped me to proceed further