Creating a Computer Account
This topic explains how to use the Active Directory module for Windows PowerShell to create a computer account.
Example 1
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'
New-ADComputer -SamAccountName Comp1 -Path ‘OU=ComputerAccounts,DC=FABRIKAM,DC=COM'
Example 2
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
New-ADComputer -SamAccountName Comp1 -Path OU=ComputerAccounts,DC=FABRIKAM,DC=COM' -AccountPassword (ConvertTo-SecureString -AsPlainText 'p@assw0rd' -Force) -Enabled $true
Additional information
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
No comments:
Post a Comment