spooter
-
Total Posts
:
17
- Scores: 0
-
Reward points
:
0
- Joined: 11/14/2007
-
Status: offline
|
Changing AD Properties with Powershell
Friday, March 28, 2008 3:43 AM
( permalink)
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.
|
|
|
|
ebgreen
-
Total Posts
:
8219
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
RE: Changing AD Properties with Powershell
Monday, March 31, 2008 2:04 AM
( permalink)
I'm confused. It looks (from the naming used) that you are using the DN to get the account. Is that not sufficient?
|
|
|
|