PowerShell Logo Small

Set-ADDomain



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

Modifies an Active Directory domain.

SYNTAX


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



Search powershellhelp.space

DESCRIPTION


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.


The following examples show how to modify the ManagedBy property of a domain object by using three methods:


-By specifying the Identity and the ManagedBy parameters


-By passing a domain object through the pipeline and specifying the ManagedBy parameter


-By specifying the Instance parameter.


Method 1: Modify the ManagedBy property for the London domain by using the Identity and ManagedBy parameters.


Set-ADDomain -Identity London -ManagedBy SaraDavis


Method 2: Modify the ManagedBy property for the London domain by passing the London domain through the pipeline and specifying the ManagedBy
parameter.


Get-ADDomain London | Set-ADDomain -ManagedBy SaraDavis


Method 3: Modify the ManagedBy property for the London domain by using the Windows PowerShell command line to modify a local instance of the
London domain. Then set the Instance parameter to the local instance.


$domain = Get-ADDomain London


$domain.ManagedBy = SaraDavis


Set-ADDomain -Instance $domain.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=219356
Get-ADDomain

REMARKS

<

Examples


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

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



Description

-----------

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




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

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


Adds the value "corp.fabrikam.com" to the AllowedDNSSuffixes in domain "FABRIKAM".



Description

-----------




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

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



Description

-----------

Sets the ManagedBy property in domain "FABRIKAM" to 'CN=Domain Admins,CN=Users,DC=FABRIKAM,DC=COM'.




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

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



Description

-----------

Sets the LastLogonReplicationInterval of the current logged on user domain to "10".