PowerShell Logo Small


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


Set-ADForest [-Identity] <ADForest> [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-PassThru] [-Server <String>] [-SPNSuffixes <Hashtable>] [-UPNSuffixes
<Hashtable>] [-Confirm] [-WhatIf] [<CommonParameters>]

Search powershellhelp.space


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.



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




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

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

This command sets the UPNSuffixes property on the fabrikam.com forest.

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

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

This command adds corp.fabrikam.com to the SPNSuffixes property on the forest fabrikam.com.

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

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

This command gets the forest of the current logged on user and updates the SPNSuffixes property.

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

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

This command gets the forest of the current logged on user and clears the UPNSuffixes property.

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

PS C:\>$Forest = Get-ADForest -Identity fabrikam.com
PS C:\> $Forest.UPNSuffixes = "fabrikam.com","fabrikam","corp.fabrikam.com"
PS C:\> Set-ADForest -Instance $Forest

This example modifies the UPNSuffixes property for the fabrikam.com forest. The example modifies a local instance of the fabrikam.com forest, and then specifies the Instance
parameter for the current cmdlet as the local instance.