Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Can't figure out why I'm getting this error on New-ADUser

$
0
0

The command is:

New-ADUser –SamAccountName “TestProvider” -UserPrincipalName "TestProv@CompanyName.com” -GivenName “Test” -Surname “Provider” -DisplayName “Test Provider” -Name "Test Provider" -Enabled $true -path “ou=CompanyName,ou=Users,ou=Providers,DN=intranet,DN=CompanyName,DN=com” -AccountPassword (ConvertTo-SecureString "TEST123test" -AsPlainText -force) -PasswordNeverExpires $True

The error is: 

New-ADUser : No superior reference has been configured for the directory service. The directory service is therefore un
    able to issue referrals to objects outside this forest
    At line:1 char:11+ New-ADUser <<<<  -SamAccountName "TestProvider" -UserPrincipalName "TestProv@CompanyName.com" -GivenName "Test" -
    Surname "Provider" -DisplayName "Test Provider" -Name "Test Provider" -Enabled $true -path "ou=CompanyName,ou=Users,ou=
    Providers,DN=intranet,DN=CompanyName,DN=com" -AccountPassword (ConvertTo-SecureString "TEST123test" -AsPlainText -force
    ) -PasswordNeverExpires $True+ CategoryInfo          : NotSpecified: (CN=Test Provide...panyName,DN=com:String) [New-ADUser], ADException+ FullyQualifiedErrorId : No superior reference has been configured for the directory service. The directory servi
       ce is therefore unable to issue referrals to objects outside this forest,Microsoft.ActiveDirectory.Management.Comm
      ands.NewADUser

I think it has something to do with the way I'm specifying the "path" but i'm not sure.
The user should be created in an OU: CompanyName > Users > Providers
The domain is intranet.companyname.com


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>