Link to home
Start Free TrialLog in
Avatar of kuzum
kuzum

asked on

home folder path for users

dear experts

I'm working on this script and partly working but it pulls AD accounts that is not in csv file

What I would like to have is the  home drive path for given users in csv file. Could you help me with this please?
csv file has colun header "SamAccountNAme" and users are listed as Mike.Beach (firstname.Surname)

import-module activedirectory
$list =import-csv "H:\temp\userlist.csv"
ForEach ($User in $UserList)
{Get-Aduser -Filter * -properties Name,homedirectory,homedrive |export-csv -path H:\temp\export\result.csv}
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India 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
Avatar of kuzum
kuzum

ASKER

EXCELLENT! it did the job I needed. I will have another question please on a separate thread if you could help please?
Sure.. post the link to question.. and don't forget to close this question.. :-)
Avatar of kuzum

ASKER

excellent result!