SHARE
TWEET

Untitled

a guest Jul 18th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #.'E:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'
  3. #Connect-ExchangeServer -auto -ClientApplication:ManagementShell
  4. $newname = "webmail.domain.org"
  5. $server = hostname
  6.  
  7.  
  8. $activesyncvd = "https://" + $newname + "/Microsoft-Server-ActiveSync"
  9. $ecpvd = "https://" + $newname + "/ecp"
  10. $mapivd = "https://" + $newname + "/mapi"
  11. $oab = "https://" + $newname + "/OAB"
  12. $owa = "https://" + $newname + "/owa"
  13. $ews = "https://" + $newname + "/EWS/Exchange.asmx"
  14. $Autodiscover = "https://" + $newname + "/Autodiscover/Autodiscover.xml"
  15.  
  16. #best config's for once Exchange has been migrated / new setup :
  17. #Get-OutlookAnywhere -ADPropertiesOnly -Server $server | Set-OutlookAnywhere -InternalHostname $newname -ExternalHostname $newname -ExternalClientsRequireSsl $true -InternalClientsRequireSsl $true -ExternalClientAuthenticationMethod Negotiate -InternalClientAuthenticationMethod Negotiate -IISAuthenticationMethods Negotiate, Ntlm, Basic
  18. #Get-MapiVirtualDirectory -ADPropertiesOnly -Server $server | Set-MapiVirtualDirectory -InternalUrl $mapivd -ExternalUrl $mapivd -IISAuthenticationMethods Negotiate, Ntlm, OAuth
  19. #Set-OrganizationConfig -MapiHttpEnabled $true
  20.  
  21. write-host "Setting up ActiveSync"
  22. Get-ActiveSyncVirtualDirectory -ADPropertiesOnly -Server $server | Set-ActiveSyncVirtualDirectory -ExternalUrl $activesyncvd -InternalUrl $activesyncvd
  23. write-host "Setting up ECP"
  24. Get-EcpVirtualDirectory -ADPropertiesOnly -Server $server | Set-EcpVirtualDirectory -InternalUrl $ecpvd -ExternalUrl $ecpvd
  25. write-host "Setting up OAB"
  26. Get-OabVirtualDirectory -ADPropertiesOnly -Server $server | Set-OabVirtualDirectory -InternalUrl $oab -ExternalUrl $oab
  27. write-host "Setting up OWA"
  28. Get-OwaVirtualDirectory -ADPropertiesOnly -Server $server | Set-OwaVirtualDirectory -InternalUrl $owa -ExternalUrl $owa
  29. write-host "Setting up EWS"
  30. Get-WebServicesVirtualDirectory -ADPropertiesOnly -Server $server | Set-WebServicesVirtualDirectory -InternalUrl $ews -ExternalUrl $ews
  31. write-host "Setting up Client Access Server"
  32. Get-ClientAccessService $server | Set-ClientAccessService -AutoDiscoverServiceInternalUri $Autodiscover
  33. write-host "Setting up Outlook Anywhere " -NoNewline
  34. write-host "for coexistence (Change to Negotiate once the project is finished)" -ForegroundColor Yellow
  35. Get-OutlookAnywhere -ADPropertiesOnly -Server $server | Set-OutlookAnywhere -ExternalHostname $newname -ExternalClientsRequireSsl $true -InternalClientsRequireSsl $true -ExternalClientAuthenticationMethod ntlm -InternalClientAuthenticationMethod ntlm -IISAuthenticationMethods Ntlm
  36. write-host "Setting up MAPI" -NoNewline
  37. write-host " And Disableing" -ForegroundColor red
  38. Get-MapiVirtualDirectory -ADPropertiesOnly -Server $server | Set-MapiVirtualDirectory -InternalUrl $mapivd -ExternalUrl $mapivd -IISAuthenticationMethods ntlm
  39. Set-OrganizationConfig -MapiHttpEnabled $false
  40.  
  41. write-host "Done"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top