PowerShell Logo Small

Set-ADComputer



This is the built-in help made by Microsoft for the command 'Set-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

Modifies an Active Directory computer object.

SYNTAX


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



Search powershellhelp.space

DESCRIPTION


The Set-ADComputer cmdlet modifies the properties of an Active Directory computer object. You can modify commonly used property values by using the cmdlet parameters.
Property values that are not associated with cmdlet parameters can be modified by using the Add, Replace, Clear, and Remove parameters.


The Identity parameter specifies the Active Directory computer to modify. You can identify a computer by its distinguished name Members (DN), GUID, security identifier (SID)
or Security Accounts Manager (SAM) account name. You can also set the Identity parameter to an object variable such as $<localComputerObject>, or you can pass an object
through the pipeline to the Identity parameter. For example, you can use the Get-ADComputer cmdlet to retrieve a computer object and then pass the object through the
pipeline to Set-ADComputer.


The Instance parameter provides a way to update a computer by applying the changes made to a copy of the computer object. When you set the Instance parameter to a copy of an
Active Directory computer object that has been modified, the Set-ADComputer cmdlet makes the same changes to the original computer object. To get a copy of the object to
modify, use the Get-ADComputer object. When you specify the Instance parameter you should not pass the Identity parameter. For more information about the Instance parameter,
see the Instance parameter description. For more information about how the instance concept is used in Active Directory cmdlets, type Get-Help about_ActiveDirectory_Instance.



<

RELATED LINKS

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

REMARKS

<

Examples


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

PS C:\>Set-ADComputer -Identity "FABRIKAM-SRV1" -ServicePrincipalName @{Replace="MSSQLSVC/FABRIKAM-SRV1.FABRIKAM.COM:1456","MSOLAPSVC.3/FABRIKAM-SRV1.FABRIKAM.COM:analyze"}



This command modifies the SPN value for the computer specified by the Identity parameter.




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

PS C:\>Set-ADComputer -Identity "FABRIKAM-SRV1" -Location "NA/HQ/Building A"



This command modifies the location for the computer specified by the Identity parameter.




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

PS C:\>Set-ADComputer -Identity "FABRIKAM-SRV1" -ManagedBy "CN=SQL Administrator 01,OU=UserAccounts,OU=Managed,DC=FABRIKAM,DC=COM"



This command sets the ManagedBy attribute value for the computer specified by the Identity parameter using the SAM account name of the user.




-------------------------- EXAMPLE 4 --------------------------

PS C:\>$comp = Get-ADComputer -Identity "FABRIKAM-SRV1"
PS C:\> $comp.Location = "NA/HQ/Building A"
PS C:\> $comp.ManagedBy = "CN=SQL Administrator 01,OU=UserAccounts,OU=Managed,DC=FABRIKAM,DC=COM"
PS C:\> Set-ADComputer -Instance $comp



This example sets the Location and ManagedBy attributes of a computer.




-------------------------- EXAMPLE 5 --------------------------

PS C:\>Get-ADComputer SaraDavisLaptop -Identity "FABRIKAM-SRV1" | Set-ADcomputer -Location "W4013"



This command modifies the Location property for the computer named FABRIKAM-SRV1. The command uses the Get-ADComputer cmdlet to get the FABRIKAM-SRV1 computer object, and
then passes the object to the current cmdlet by using the pipeline operator.