PowerShell Logo Small


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


Modifies an Active Directory domain.


Set-ADDomain [-Identity] <ADDomain> [-Add <Hashtable>] [-AllowedDNSSuffixes <Hashtable>] [-AuthType {Negotiate | Basic}] [-Clear <String[]>] [-Credential <PSCredential>]
[-LastLogonReplicationInterval <TimeSpan>] [-ManagedBy <ADPrincipal>] [-PassThru] [-Remove <Hashtable>] [-Replace <Hashtable>] [-Server <String>] [-Confirm] [-WhatIf]
Set-ADDomain [-AllowedDNSSuffixes <Hashtable>] [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-LastLogonReplicationInterval <TimeSpan>] [-ManagedBy
<ADPrincipal>] [-PassThru] [-Server <String>] -Instance <ADDomain> [-Confirm] [-WhatIf] [<CommonParameters>]

Search powershellhelp.space


The Set-ADDomain cmdlet modifies the properties of an Active Directory domain. 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 domain to modify. You can identify a domain by its distinguished name (DN), GUID, security identifier (SID), DNS domain name, or NetBIOS
name. You can also set the Identity parameter to an object variable such as $<localDomainObject>, or you can pass an object through the pipeline to the Identity parameter.
For example, you can use the Get-ADDomain cmdlet to retrieve a domain object and then pass the object through the pipeline to the Set-ADDomain cmdlet.

The Instance parameter provides a way to update a domain object by applying the changes made to a copy of the domain object. When you set the Instance parameter to a copy of
an Active Directory domain object that has been modified, the Set-ADDomain cmdlet makes the same changes to the original domain object. To get a copy of the object to
modify, use the Get-ADDomain 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.



Online Version: http://go.microsoft.com/fwlink/p/?linkid=291116




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

PS C:\>Set-ADDomain -Identity FABRIKAM -AllowedDNSSuffixes @{Replace="fabrikam.com","corp.fabrikam.com"}

This command sets the value of AllowedDNSSuffixes to {"fabrikam.com","corp.fabrikam.com"} in domain FABRIKAM.

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

PS C:\>Set-ADDomain -Identity FABRIKAM -AllowedDNSSuffixes @{Add="corp.fabrikam.com"}

This command adds the value corp.fabrikam.com to the AllowedDNSSuffixes in domain FABRIKAM.

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

PS C:\>Set-ADDomain -Identity FABRIKAM -ManagedBy 'CN=Domain Admins,CN=Users,DC=FABRIKAM,DC=COM'

This command sets the ManagedBy property in domain FABRIKAM to CN=Domain Admins,CN=Users,DC=FABRIKAM,DC=COM.

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

PS C:\>Get-ADDomain | Set-ADDomain -LastLogonReplicationInterval "10"

This command sets the LastLogonReplicationInterval of the current logged on user domain to 10.

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

PS C:\>$Domain = Get-ADDomain -Identity London
PS C:\> $Domain.ManagedBy = PattiFuller
PS C:\> Set-ADDomain -Instance $Domain

This example modifies the ManagedBy property for the London domain. The example modifies a local instance of the London domain, and then specifies the Instance parameter for
the current cmdlet as the local instance.