I’m trying to create an OU with PowerShell, but the command returns “server unwilling” or “access is denied.” Creating an OU in the GUI works. What should I check first?
Why does New-ADOrganizationalUnit say “server unwilling”?
Answers
First check which account the PowerShell process is actually using. If you opened a session under a different account or in a remote desktop session, it may not have the permissions you expect. Run the command with an account allowed to create OUs in that location. Launching PowerShell as administrator can help with local machine permissions, but it does not by itself grant domain permissions.
Reply to this answer
There’s also a syntax issue in the examples: put a space between the closing quote for the `-Path` value and the next parameter. For example: `New-ADOrganizationalUnit -Name "Test" -Path "DC=Noiz,DC=local" -ProtectedFromAccidentalDeletion $false`. Check the distinguished name against the actual domain naming context before running it.
Reply to this answer
“Access is denied” points strongly toward permissions or credentials. “Server unwilling” is less specific, so I’d verify the target path and the account’s rights there, then try the corrected command. If you’re using a remote session, confirm its credentials and which domain controller it’s talking to rather than assuming it matches the GUI session.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions