ncomper
asked on
Export list of users who have specific unc path in home folder attribute
Hi All
I am looking for a script that can search our domain and export only users that have \\server01\Users\ in the path for the Home folder attribute (Not Local Path)
If it could export the SamAccountName, full Homefolder path and the chosen drive letter thats in the drop down
Our AD is Windows 2003 level with all DC's at Win 2003 SP2 (not R2)
Is this possible
Thanks
I am looking for a script that can search our domain and export only users that have \\server01\Users\ in the path for the Home folder attribute (Not Local Path)
If it could export the SamAccountName, full Homefolder path and the chosen drive letter thats in the drop down
Our AD is Windows 2003 level with all DC's at Win 2003 SP2 (not R2)
Is this possible
Thanks
I would suggest trying joeware's adfind (www.joeware.net) although you may need to export the attributes for all into excel and sort in excel. Have a look though as I remember it was a really powerful tool last time I used it...
If you can use powershell, here is the scripts you need:
First type this
import-module ActiveDirectory
Press Enter
Now cut and pastes this:
Get-ADUser -Filter * -SearchBase "DC=YOUR_DOMAIN,DC=COM" -Properties * | Select-Object SamAccountName,GivenName,S urname,Dis playName,H omeDirecto ry | export-csv -path AllADUsers_v3.csv -NoTypeInformation -Encoding "UTF8"
Change the DC line to match your domain.
Open up your cvs vile, make a filter on the first line and then you can sort the HomeDirectory field.
First type this
import-module ActiveDirectory
Press Enter
Now cut and pastes this:
Get-ADUser -Filter * -SearchBase "DC=YOUR_DOMAIN,DC=COM" -Properties * | Select-Object SamAccountName,GivenName,S
Change the DC line to match your domain.
Open up your cvs vile, make a filter on the first line and then you can sort the HomeDirectory field.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
You got me on the right path, when i ran that it wasnt displaying correctly but i modified it to the below and its working well
DSQuery * -Filter "(&((objectCategory=Person )(objectCl ass=User)( homeDirect ory=\5c\5c server01\5 cusers\5c* )))" -Attr samAccountName Name homeDirectory -limit 0 >c:\Users.txt
Thanks again
Nick
You got me on the right path, when i ran that it wasnt displaying correctly but i modified it to the below and its working well
DSQuery * -Filter "(&((objectCategory=Person
Thanks again
Nick
ASKER
DSQuery * -Filter "(&((objectCategory=Person )(objectCl ass=User)( homeDirect ory=\5c\5c server01\5 cusers\5c* )))" -Attr samAccountName Name homeDirectory -limit 0 >c:\Users.txt
Modified slightly to this but 99.99% there.
Thanks
Modified slightly to this but 99.99% there.
Thanks