Export (0) Print
Expand All

Creating a Computer Account

Updated: February 28, 2009

Applies To: Windows Server 2008 R2

This topic explains how to use the Active Directory module for Windows PowerShell to create a computer account.

The following example demonstrates how to create a new computer, Comp1, in the OU ComputerAccounts in the Fabrikam.com domain:

New-ADComputer -SamAccountName Comp1 -Path ‘OU=ComputerAccounts,DC=FABRIKAM,DC=COM'

The following example demonstrates how to create a new computer, Comp1, with the password p@ssword in the OU ComputerAccounts in the Fabrikam.com domain:

New-ADComputer -SamAccountName Comp1 -Path OU=ComputerAccounts,DC=FABRIKAM,DC=COM' -AccountPassword (ConvertTo-SecureString -AsPlainText 'p@assw0rd' -Force) -Enabled $true

You can use the following parameters when you set many of the common values that are associated with creating a computer:

  • Description

  • DisplayName

  • -DNSHostName

  • -Enabled

  • -Location

  • -ManagedBy

  • -OperatingSystem

  • -OperatingSystemHotfix

  • -OperatingSystemServicePack

  • -OperatingSystemVersion

  • -ServicePrincipalNames

  • -TrustedForDelegation

For a full explanation of the parameters that you can pass to New-ADComputer, at the Active Directory module command prompt, type Get-Help New-ADComputer –detailed, and then press ENTER.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft