Powershell New-ADUser failing from remote execution

Anonymous
2023-03-31T14:54:24.2533333+00:00

Good morning all!
We are using Freshservice to try to automate some of our employee onboarding and are getting some access is denied errors when running. The App is essentially sending the powershell command on behalf of the account we have specifically set up for this app:
Access is denied At line:1 char:1 + New-ADUser -Name 'Freshservice.Test' -AccountPassword (ConvertTo-Secu ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (CN=Freshservice...comany,DC=com:String) [New-ADUser], UnauthorizedAccessException + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.UnauthorizedAccessException,Microsoft.ActiveDirectory.Management.Commands.NewADUser

We have set up a local admin account to run these commands on our server, but not sure why they would be failing? I am on our application support/Fresh service team so unfortunately i am not super knowledgeable about this realm of things. I appreciate any info or help!

Windows for business | Windows Server | User experience | PowerShell

Locked Question. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Oldest
  1. Rich Matheisen 48,121 Reputation points
    2023-03-31T15:14:48.96+00:00

    Whatever the account is that's being used doesn't have permission to create new AD users. This isn't a PowerShell problem, it's a problem for your AD admin to rectify by assigning the account to a group that has the necessary permissions to accomplish the work.

    Was this answer helpful?

    0 comments No comments
  2. Leonardo Bazterrica 0 Reputation points
    2026-09-25T18:44:59.51+00:00

    It might be a little late to respond, but in case this happens to anyone else:

    1. As mentioned above, make sure you have AD permissions.
    2. Launch PowerShell as an administrator, EVEN IF YOU'RE LOGGED IN WITH AN ADMIN ACCOUNT.

    Was this answer helpful?

    0 comments No comments