Author Posts

January 1, 2012 at 12:00 am

by gerhardt7 at 2012-12-18 02:36:19

i want set all users in ad with a powershell script now i have made this script but it doesnt work

New-ADUser -Path "ou=Users,dc=ad.handel,dc=nl" -Name "Gerhard Timmerman"
-SAMAccountName "Gerhard.Timmerman" -UserPrincipalName "gerhard.timmerman@ad.handel"
-EmailAddress "gerhard.timmerman@gt-service.nl" -GivenName "Gerhard" -Surname "Timmerman"
-Description "Gerhard voorbeeld"
-Company "gtservice, nl." -Department "Admin"
-Office "Nederland" -AccountPassword (ConvertTo-SecureString
-AsPlainText "P@ssw0rd" -Force)
-ChangePasswordAtLogon $true -Enabled $true

i want change this to made it with values
demo:
-SAMAccountName $username -UserPrincipalName $prinname
csv:
prinname,email,firstname,lastname,description,office,password

i want that i automtic make gehrard.timmerman (firstname + . + lastname)
how must i do this and that the samacount username . lastname is
and what have i done wrong that its not working

by Klaas at 2012-12-18 04:41:07

Gerhard
can you post the entire script you're using now and a few lines of you csv file, please?