P S
asked on
Need help in modifying an existing script
I've a script to create bul kuser accounts. Script is working fine and accounts are getting created properly, However i Need help in modifying this script.
for all accounts that are getting created, I need to set a common atribute "XYZ" to value "112233". Can someone help me modifying the existing script.
FYI, Below is the script.
Import-Csv C:Temp\BulkAccountcreation .csv | foreach-object {
$userprinicpalname = $_.SamAccountName + “@Test.COM”
New-ADUser -SamAccountName $_.SamAccountName -UserPrincipalName $userprinicpalname -Name $_.name -DisplayName $_.name -GivenName $_.cn -SurName $_.sn -Department $_.Department -Path “OU=Test,OU=Test2,OU=Test1 ,OU=Test,D C=Test,DC= COM” -AccountPassword (ConvertTo-SecureString “Microsoft~1;” -AsPlainText -force) -Enabled $True -PasswordNeverExpires $True -PassThru }
Thanks.
for all accounts that are getting created, I need to set a common atribute "XYZ" to value "112233". Can someone help me modifying the existing script.
FYI, Below is the script.
Import-Csv C:Temp\BulkAccountcreation
$userprinicpalname = $_.SamAccountName + “@Test.COM”
New-ADUser -SamAccountName $_.SamAccountName -UserPrincipalName $userprinicpalname -Name $_.name -DisplayName $_.name -GivenName $_.cn -SurName $_.sn -Department $_.Department -Path “OU=Test,OU=Test2,OU=Test1
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER