# This script configures both the upnSuffix for your hosted companies for the Domains and Trusts and Company OU # Version 1.0 # This script should be used when you have added a new Hosted Company to your Segmented Exchange Infrastructure # Write-Host "This script configures both the upnSuffix for your hosted companies for the Domains and Trusts and Company OU" Write-Host "" Write-Host "Option 1 = Configure Domains and Trusts UPNSuffix" Write-Host "Option 2 = Configure Company OU UPNSuffix" Write-Host "" # Get Domain Controller $rootDSE = [adsi]"LDAP://RootDSE" $DC = $rootDSE.dnsHostName $choice = Read-Host "What would you like to do?" If ($choice -eq 1){ $upnDT = Read-Host "Please enter in the new Domains and Trusts UPNSuffix (e.g mycompanydomain.com)" $upnDTc = "$upnDT" $Part =[ADSI]"LDAP://cn=partitions,$($rootDSE.configurationNamingContext)" $Part.uPNSuffixes +=$upnDTc $Part.Setinfo() } If ($choice -eq 2){ $upnDT = Read-Host "Please enter in the new Company OUT UPNSuffix (e.g mycompanydomain.com)" $upnDTC = "$upnDT" $OUName = Read-Host "Please Enter in the name of the OU for your Hosted Company" $OUVAL = Get-QADObject $OUName | Select DN $Part = [ADSI]"LDAP://$DC/$($OUVAL.DN)" $Part.uPNSuffixes +=$upnDTC $Part.Setinfo() } Write-Host "" Write-Host "Script Completed"