Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Move a mailbox to an other DB:
- New-MoveRequest -Identity "username@domain.com" -TargetDatabase "DB02"
- # Display a list of moving mailboxes and percentage:
- Get-MoveRequest | Get-MoveRequestStatistics
- # Remove all completed requests:
- Get-MoveRequest -movestatus completed | remove-moverequest
- # Verify if the mailbox is moved
- Get-Mailbox "username@domain.com" | Format-List Database
- # List mailboxes in a DB
- Get-Mailbox -Database "DB_NAME" | ft Name, Alias, WindowsEmailAddress, UserPrincipalName
- # Display DB Size
- Get-MailboxDatabase -status| Select Name, DatabaseSize, AvailableNewMailboxSpace
- # Export results to a CSV file
- | Export-Csv C:\temp\MailboxesDB02.csv -NoTypeInformation -Encoding UTF8 -Delimiter ';'
- # Set Sending Limit
- Set-ReceiveConnector -Identity "Client Frontend MAILSERVER_NAME" -MessageRateLimit 200
- # Set Static DC / DNS Server for Exchange
- Set-ExchangeServer -Identity <Server> -StaticDomainControllers DC-01.dc.local,DC-02.dc.local
- Set-ExchangeServer -Identity <Server> -StaticGlobalCatalogs DC-01.dc.local,DC-02.dc.local
- ___________________________________________________________________________________________________________________
- # Set Exchange URLs
- Variables:
- $OutlookHostname = "SERVERNAME.DOMAIN.COM"
- $ExternalOutlookHostname = "SERVERNAME.DOMAIN.COM"
- __________________________________________________________
- #Hostname für Autodiscover:
- $AutodiscoverHostname = "autodiscover.domain.com"
- ___________________________________________________________
- #ServerName
- $Server = "LOCAL_EXCHANGE-SERVER_NAME"
- ___________________________________________________________
- #OWA
- $owa = "https://" + "$OutlookHostname" + "/owa"
- $owaext = "https://" + "$ExternalOutlookHostname" + "/owa"
- write-host "OWA URL:" $owa
- Get-OwaVirtualDirectory -Server $Server | Set-OwaVirtualDirectory -internalurl $owa -externalurl $owaext
- #ECP
- $ecp = "https://" + "$OutlookHostname" + "/ecp"
- $ecpext = "https://" + "$ExternalOutlookHostname" + "/ecp"
- write-host "ECP URL:" $ecp
- Get-EcpVirtualDirectory -server $Server | Set-EcpVirtualDirectory -internalurl $ecp -externalurl $ecpext
- #EWS
- $ews = "https://" + "$OutlookHostname" + "/EWS/Exchange.asmx"
- $ewsext = "https://" + "$ExternalOutlookHostname" + "/EWS/Exchange.asmx"
- write-host "EWS URL:" $ews
- Get-WebServicesVirtualDirectory -server $Server | Set-WebServicesVirtualDirectory -internalurl $ews -externalurl $ewsext -confirm:$false -force
- #ActiveSync
- $eas = "https://" + "$OutlookHostname" + "/Microsoft-Server-ActiveSync"
- $easext = "https://" + "$ExternalOutlookHostname" + "/Microsoft-Server-ActiveSync"
- write-host "ActiveSync URL:" $eas
- Get-ActiveSyncVirtualDirectory -Server $Server | Set-ActiveSyncVirtualDirectory -internalurl $eas -externalurl $easext
- #OAB
- $oab = "https://" + "$OutlookHostname" + "/OAB"
- $oabext = "https://" + "$ExternalOutlookHostname" + "/OAB"
- write-host "OAB URL:" $oab
- Get-OabVirtualDirectory -Server $Server | Set-OabVirtualDirectory -internalurl $oab -externalurl $oabext
- #MAPIoverHTTP
- $mapi = "https://" + "$OutlookHostname" + "/mapi"
- $mapiext = "https://" + "$ExternalOutlookHostname" + "/mapi"
- write-host "MAPI URL:" $mapi
- Get-MapiVirtualDirectory -Server $Server| Set-MapiVirtualDirectory -internalurl $mapi -externalurl $mapiext
- #Outlook Anywhere
- write-host "OA Hostname:" $OutlookHostname
- Get-OutlookAnywhere -Server $Server| Set-OutlookAnywhere -internalhostname $OutlookHostname -InternalClientsRequireSsl $true
- #Autodiscover SCP
- $autodiscover = "https://" + "$OutlookHostname" + "/Autodiscover/Autodiscover.xml"
- write-host "Autodiscover URL:" $autodiscover
- Get-ClientAccessService $Server | Set-ClientAccessService -AutoDiscoverServiceInternalUri $autodiscover
Add Comment
Please, Sign In to add comment