| |
spooter
Posts: 15
Score: 0
Joined: 11/14/2007
Status: offline
|
Hi all, Not much activity here? I am trying to a powershell script which users a CSV file which contains the users SamaccountName, Department and Title. At the moment I have the below which works if I use the CN to find them but this isnt a unquie identifer so I need to use the samaccountname, any ideas on how this can be done? I think I aslo need it to connect to the default ad route rather than taking the path from a CSV file. $users = import-csv users.csv foreach($row in $users) { $dn = $row.dn $user=[ADSI]LDAP://$dn $title = $row.title $department = $row.department $user.put("title", $title) $user.put("department", $department) $user.SetInfo() } Typed this up pretty quick so sorry if it doesnt make much sense.
|
|