PowerShell Logo Small

Set-ADForest



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

SYNTAX


Set-ADForest [-Identity] <ADForest> [-AuthType <ADAuthType>] [-Credential <PSCredential>] [-PassThru [<SwitchParameter>]] [-Server <String>]
[-SPNSuffixes <Hashtable>] [-UPNSuffixes <Hashtable>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


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


The Instance parameter provides a way to update a forest object by applying the changes made to a copy of the object. When you set the
Instance parameter to a copy of an Active Directory forest object that has been modified, the Set-ADForest cmdlet makes the same changes to
the original forest object. To get a copy of the object to modify, use the Get-ADForest object. The Identity parameter is not allowed when you
use the Instance parameter. For more information about the Instance parameter, see the Instance parameter description.


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


-By specifying the Identity and the UPNSuffixes parameters


-By passing a forest object through the pipeline and specifying the UPNSuffixes parameter


-By specifying the Instance parameter.


Method 1: Modify the UPNSuffixes property for the fabrikam.com forest by using the Identity and UPNSuffixes parameters.


Set-ADForest -Identity fabrikam.com -UPNSuffixes @{replace="fabrikam.com","fabrikam","corp.fabrikam.com"}


Method 2: Modify the UPNSuffixes property for the fabrikam.com forest by passing the fabrikam.com forest through the pipeline and specifying
the UPNSuffixes parameter.


Get-ADForest -Identity fabrikam.com | Set-ADForest -UPNSuffixes @{replace="fabrikam.com","fabrikam","corp.fabrikam.com"}


Method 3: Modify the UPNSuffixes property for the fabrikam.com forest by using the Windows PowerShell command line to modify a local instance
of the fabrikam.com forest. Then set the Instance parameter to the local instance.


$forest = Get-ADForest -Identity fabrikam.com


$forest.UPNSuffixes = "fabrikam.com","fabrikam","corp.fabrikam.com"


Set-ADForest -Instance $forest.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=219350
Get-ADForest
Set-ADForestMode

REMARKS

<

Examples


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

C:\PS>Set-ADForest -Identity fabrikam.com -UPNSuffixes @{replace="fabrikam.com","fabrikam","corp.fabrikam.com"}



Description

-----------

Set the UPNSuffixes property on the fabrikam.com forest.




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

C:\PS>Set-ADForest -Identity fabrikam.com -SPNSuffixes @{add="corp.fabrikam.com"}



Description

-----------

Add corp.fabrikam.com to the SPNSuffixes property on the forest fabrikam.com




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

C:\PS>Get-ADForest | Set-ADForest -SPNSuffixes @{Add="corp.fabrikam.com";Remove="fabrikam"}



Description

-----------

Get the forest of the current logged on user and update the SPNSuffixes property.




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

C:\PS>Get-ADForest | Set-ADForest -UPNSuffixes $null



Description

-----------

Get the forest of the current logged on user and clear the UPNSuffixes property.