PowerTip: Create Computer Account in Active Directory with PowerShell

PowerTip: Create Computer Account in Active Directory with PowerShell

  • Comments 9
  • Likes

Summary: Use the Active Directory module to create a new computer account.

Hey, Scripting Guy! Question How can I use Windows PowerShell to create a computer account in Active Directory?

Hey, Scripting Guy! AnswerTo create a new computer called ScriptoPC, execute the following line in an Active Directory environment
          with a domain controller running Windows Server 2012 R2, Windows Server 2012, or Windows Server 2008 R2:

New-ADcomputer –name “ScriptoPC” –SamAccountName “ScriptoPC”

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Adding to this New-ADcomputer –name “ScriptoPC” –SamAccountName “ScriptoPC” -Enabled $true Enabled will be set to true and add -path to specify the OU

  • Thanks Its helped me to reduce the manual work. Now I can run my powershell script without any manual work.

  • Thanks Its helped me to reduce the manual work. Now I can run my powershell script without any manual work.

  • Thanks Its helped me to reduce the manual work. Now I can run my powershell script without any manual work.