Deltahost
Deltahost

Reputation: 117

Powershell domain join directly to specified OU not working

I'm trying to join a computer to a domain with a specified OU by using Powershell.

Add-Computer -domainname mydomain.net -OUPath "OU=W2k8 R2 Servers,OU=Servers,DC=mydomain,DC=net" -cred [email protected] -passthru –verbose

I get the Error:

This command cannot be executed on target computer('ch88s170') due to following error: Access is denied.

When I use this command and do not specify a OU then it works!?

Add-Computer -domainname mydomain.net -cred [email protected] -passthru –verbose

Could it be caused because of a Active Directory Policy restriction? Which one? What should i try next to find a solution?

P.S. Firewall is disabled, Powershell runing as Administrator without UAC, OS: Windows Server 2008 R2

Upvotes: 1

Views: 7844

Answers (1)

Deltahost
Deltahost

Reputation: 117

As Adi Inbar has told me:

The account ([email protected]) didn't have had permissions to create new objects in that OU. I though when a user can join to a domain the user have also the permisson to join directly to a OU, so i didn't check the permissions. After I added the "Create all child objects" the problem was solved!

Upvotes: 1

Related Questions