AD Powershell problem.

Status
Not open for further replies.

Morphineandketamine

Commendable
Jan 19, 2017
2
0
1,510
0
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.
Thread starter Similar threads Forum Replies Date
I Social Networking 0
C Social Networking 1
G Social Networking 0
A Social Networking 2
F Social Networking 2
G Social Networking 2
F Social Networking 2
S Social Networking 1
A Social Networking 1
E Social Networking 1
A Social Networking 1
D Social Networking 1
A Social Networking 3
R Social Networking 1
G Social Networking 0
H Social Networking 1
A Social Networking 1
W Social Networking 1
C Social Networking 3
T Social Networking 3

ASK THE COMMUNITY