PowerShell Logo Small

New-ADComputer



This is the built-in help made by Microsoft for the command 'New-ADComputer', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 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>] [-AuthType <ADAuthType>] [-CannotChangePassword <Boolean>] [-Certificates <X509Certificate[]>]
[-ChangePasswordAtLogon <Boolean>] [-CompoundIdentitySupported <Boolean>] [-Credential <PSCredential>] [-Description <String>] [-DisplayName
<String>] [-DNSHostName <String>] [-Enabled <Boolean>] [-HomePage <String>] [-Instance <ADComputer>] [-KerberosEncryptionType
<ADKerberosEncryptionType>] [-Location <String>] [-ManagedBy <ADPrincipal>] [-OperatingSystem <String>] [-OperatingSystemHotfix <String>]
[-OperatingSystemServicePack <String>] [-OperatingSystemVersion <String>] [-OtherAttributes <Hashtable>] [-PassThru [<SwitchParameter>]]
[-PasswordNeverExpires <Boolean>] [-PasswordNotRequired <Boolean>] [-Path <String>] [-PrincipalsAllowedToDelegateToAccount <ADPrincipal[]>]
[-SAMAccountName <String>] [-Server <String>] [-ServicePrincipalNames <String[]>] [-TrustedForDelegation <Boolean>] [-UserPrincipalName
<String>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]] [<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. For examples and more information, see the Instance parameter
description for this cmdlet.


Method 3: Use the Import-CSV cmdlet with the Add-ADComputer 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 through the pipeline to the New-ADComputer cmdlet to create the computer objects.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=219325
Add-ADComputerServiceAccount
Get-ADComputer
Get-ADComputerServiceAccount
Remove-ADComputer
Remove-ADComputerServiceAccount
Set-ADComputer

REMARKS

<

Examples


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

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



Description

-----------

Create a new computer account in the OU: "OU=ApplicationServers,OU=ComputerAccounts,OU=Managed,DC=FABRIKAM,DC=COM".




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

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



Description

-----------

Create a new computer account under a particular OU, which is enabled and located in "Redmond,WA".




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

C:\PS>$templateComp = get-adcomputer "LabServer-00" -properties
"Location","OperatingSystem","OperatingSystemHotfix","OperatingSystemServicePack","OperatingSystemVersion"; New-ADComputer -Instance
$templateComp -Name "LabServer-01"



Description

-----------

Creates a new computer account from a template object.