PowerShell Logo Small

New-ADComputer



This is the built-in help made by Microsoft for the command 'New-ADComputer', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Creates a new Active Directory computer.

SYNTAX


New-ADComputer [-Name] <String> [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>] [-AccountPassword <SecureString>] [-AllowReversiblePasswordEncryption
<Boolean>] [-AuthenticationPolicy <ADAuthenticationPolicy>] [-AuthenticationPolicySilo <ADAuthenticationPolicySilo>] [-AuthType {Negotiate | Basic}] [-CannotChangePassword
<Boolean>] [-Certificates <X509Certificate[]>] [-ChangePasswordAtLogon <Boolean>] [-CompoundIdentitySupported <Boolean>] [-Credential <PSCredential>] [-Description <String>]
[-DisplayName <String>] [-DNSHostName <String>] [-Enabled <Boolean>] [-HomePage <String>] [-Instance <ADComputer>] [-KerberosEncryptionType {None | DES | RC4 | AES128 |
AES256}] [-Location <String>] [-ManagedBy <ADPrincipal>] [-OperatingSystem <String>] [-OperatingSystemHotfix <String>] [-OperatingSystemServicePack <String>]
[-OperatingSystemVersion <String>] [-OtherAttributes <Hashtable>] [-PassThru] [-PasswordNeverExpires <Boolean>] [-PasswordNotRequired <Boolean>] [-Path <String>]
[-PrincipalsAllowedToDelegateToAccount <ADPrincipal[]>] [-SAMAccountName <String>] [-Server <String>] [-ServicePrincipalNames <String[]>] [-TrustedForDelegation <Boolean>]
[-UserPrincipalName <String>] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The New-ADComputer cmdlet creates a new Active Directory computer object. This cmdlet does not join a computer to a domain. You can set commonly used computer property
values by using the cmdlet parameters. Property values that are not associated with cmdlet parameters can be modified by using the OtherAttributes parameter.


You can use this cmdlet to provision a computer account before the computer is added to the domain. These pre-created computer objects can be used with offline domain join,
unsecure domain join, and RODC domain join scenarios.


The Path parameter specifies the container or organizational unit (OU) for the new computer. When you do not specify the Path parameter, the cmdlet creates a computer
account in the default container for computer objects in the domain.


The following methods explain different ways to create an object by using this cmdlet.


Method 1: Use the New-ADComputer cmdlet, specify the required parameters, and set any additional property values by using the cmdlet parameters.


Method 2: Use a template to create the new object. To do this, create a new computer object or retrieve a copy of an existing computer object and set the Instance parameter
to this object. The object provided to the Instance parameter is used as a template for the new object. You can override property values from the template by setting cmdlet
parameters.


Method 3: Use the Import-Csv cmdlet with the Add-ADComputerServiceAccount cmdlet to create multiple Active Directory computer objects. To do this, use the Import-Csv cmdlet
to create the custom objects from a comma-separated value (CSV) file that contains a list of object properties. Then pass these objects to the New-ADComputer cmdlet by using
the pipeline operator to create the computer objects.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=291064
Add-ADComputerServiceAccount
Get-ADComputer
Get-ADComputerServiceAccount
Remove-ADComputer
Remove-ADComputerServiceAccount
Set-ADComputer
Set-ADAccountPassword
New-ADUser

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>New-ADComputer -Name "FABRIKAM-SRV2" -SamAccountName "FABRIKAM-SRV2" -Path "OU=ApplicationServers,OU=ComputerAccounts,OU=Managed,DC=FABRIKAM,DC=COM"



This command creates a new computer account in the OU OU=ApplicationServers,OU=ComputerAccounts,OU=Managed,DC=FABRIKAM,DC=COM.




-------------------------- EXAMPLE 2 --------------------------

PS C:\>New-ADComputer -Name "FABRIKAM-SRV3" -SamAccountName "FABRIKAM-SRV3" -Path "OU=ApplicationServers,OU=ComputerAccounts,OU=Managed,DC=FABRIKAM,DC=COM" -Enabled $True
-Location "Redmond,WA"



This command creates a new computer account under a particular OU, which is enabled and located in Redmond, WA.




-------------------------- EXAMPLE 3 --------------------------

PS C:\>$templateComp = Get-ADComputer -Name "LabServer-00" -Properties
"Location","OperatingSystem","OperatingSystemHotfix","OperatingSystemServicePack","OperatingSystemVersion"
PS C:\> New-ADComputer -Instance $templateComp -Name "LabServer-01"



This example creates a new computer account from a template object.