Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Grab username from CSV and then check if in AD

$
0
0

I have a script that  writes data to the telephone fax field in AD. First it imports the csv file and then checks AD by the first field which is samAccountname and then finds out if fax field is blank or not . If it is not blank it tells user fax field contains a fax number already. If it is blank it writes the new fax number.  I have it working if i manually ad the get-aduser. I can not figure out how to have the for each loop to make it work .

 

I have included sample csv and script .

 

(Please visit the site to view this media)


Viewing all articles
Browse latest Browse all 6937

Trending Articles