AD Trust

The script is in addition to Active Directory PowerShell module that allow administrator to create Active Directory trust relationship between two domains or forests. It allow to create one-way trust or two-way trust. Scripts also allow administrator to remove created trust. It uses a built-in .NET class with methods CreateTrustRelationship and DeleteTrustRelationship.

 
Examples of using script (Source code of module is in attachment):

 

PowerShell
Edit|Remove
New-ADDomainTrust -RemoteDomain "fabrikam.com" -RemoteAdmin "Administrator" -RemotePassword "P@ssw0rd" -TrustDirection "Outbound"   
  
Remove-ADDomainTrust -RemoteDomain "fabrikam.com" -RemoteAdmin "Administrator" -RemotePassword "P@ssw0rd"  
  
New-ADForestTrust -RemoteForest "fabrikam.com" -RemoteAdmin "Administrator" -RemotePassword "P@ssw0rd" -TrustDirection "Outbound"  
   
Remove-ADForestTrust -RemoteForest "fabrikam.com" -RemoteAdmin "Administrator" -RemotePassword "P@ssw0rd"