Status
Not open for further replies.

Morphineandketamine

Commendable
Jan 19, 2017
2
0
1,510
Im pritty new to this any help or tips would be appreciated. Trying to Add users in bulk, Getting this error:

New-ADUser : The server is unwilling to process the request
At C:\Users\Kaliadm\Desktop\Users script.ps1:5 char:1
+ New-ADUser -GivenName $($_.FirstName) -Surname $($_.Lastname) `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (CN=Parvati Durg...a.kali,dc=Local:String)
[New-ADUser], ADException
+ FullyQualifiedErrorId : ActiveDirectoryServer:0,Microsoft.ActiveDirectory.Manage
ment.Commands.NewADUser

New-ADUser : The server is unwilling to process the request
At C:\Users\Kaliadm\Desktop\Users script.ps1:5 char:1
+ New-ADUser -GivenName $($_.FirstName) -Surname $($_.Lastname) `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (CN=Durga Kali,o...a.kali,dc=Local:String)
[New-ADUser], ADException
+ FullyQualifiedErrorId : ActiveDirectoryServer:0,Microsoft.ActiveDirectory.Manage
ment.Commands.NewADUser
_____________________________________________________________________________
Script
_____________________________________________________________________________
$secpass = Read-Host "Password" -AsSecureString
Import-Csv "C:\users\Kaliadm\Desktop\Active directory Eksperiment server UsersRemastered.csv" |
foreach {
$name = "$($_.LastName) $($_.FirstName)"
New-ADUser -GivenName $($_.FirstName) -Surname $($_.Lastname) `
-Name $name -SamAccountName $($_.SamAccountName) `
-UserPrincipalName "$($_.SamAccountName)@Maha.Kali.Local" `
-AccountPassword $secpass -Path "ou=Users1000,dc=Maha.kali,dc=Local" `
-Enabled:$true
}
 
Status
Not open for further replies.

TRENDING THREADS