Automate Forest trust creation

Just a quick note: In case you were not aware – netdom.exe cannot create a Forest trust (inbound or outbound). But you can leverage the S.DS namespace to automate this with a little powershell:     $targetForestName = “targetForest.local” $trustPassword = “PassWord123!23” $TrustDirection = “Outbound”   # see http://msdn.microsoft.com/en-us/library/system.directoryservices.activedirectory.trustdirection.aspx $Forest  = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() $Forest.CreateLocalSideOfTrustRelationship($targetForestName,$TrustDirection,$trustPassword)   or both sides:…

1