locked
Why do I get an Access Denied error when running 'New-Aduser' but I can create a new user account with ADUC? RRS feed

  • Question

  • Hello,

    Im logged onto my domain as a Domain Admin.  When I run 'Import-Csv c:\somefile.csv | New-Aduser' I get an Access Denied error as indicated below.  Domain Admins has 'Full Control' on the Users Container which is where this is headed.  I can however define this user fine in the Users Container using Active Directory Users and Computers.  Any ideas?

    New-ADUser : Access is denied
    At line:1 char:51
    + Import-csv c:Somefile.csv | New-Aduser <<<<  -path "cn=users,dc=acme
    ,dc=com"
        + CategoryInfo          : PermissionDenied: (CN=BugsB,cn=use...c=acme,dc
       =com:String) [New-ADUser], UnauthorizedAccessException
        + FullyQualifiedErrorId : Access is denied,Microsoft.ActiveDirectory.Manag
       ement.Commands.NewADUser


    Thanks for your help! SdeDot

    Friday, March 23, 2012 6:04 PM

Answers

  • Are you running the command from an elevated PowerShell console using "run-as administrator" when right-clicking on PowerShell to open it up?

    Boe Prox

    Please remember to mark the best solution as the answer using Mark as Answer. If you find a solution to be helpful, please use Vote as Helpful.

    Looking for a script? Check out the Script Repository
    Need a script written for you? Submit a request at the Script Request Page

    • Marked as answer by SdeDot Friday, March 23, 2012 6:18 PM
    Friday, March 23, 2012 6:13 PM

All replies

  • Are you running the command from an elevated PowerShell console using "run-as administrator" when right-clicking on PowerShell to open it up?

    Boe Prox

    Please remember to mark the best solution as the answer using Mark as Answer. If you find a solution to be helpful, please use Vote as Helpful.

    Looking for a script? Check out the Script Repository
    Need a script written for you? Submit a request at the Script Request Page

    • Marked as answer by SdeDot Friday, March 23, 2012 6:18 PM
    Friday, March 23, 2012 6:13 PM
  • Duh.....that worked, so thanks for the help Boe!

    Thanks for your help! SdeDot

    Friday, March 23, 2012 6:18 PM

  • I was getting the same error even though PS was running as admin. It turned out to be lack of permissions on the OU that I was trying to create the user in. I ended up delegating control to my account on the OU and could then successfully create the user.
    Wednesday, November 1, 2017 3:53 AM