Book Image

Microsoft Exchange Server Powershell Cookbook (Update)

Book Image

Microsoft Exchange Server Powershell Cookbook (Update)

Overview of this book

Table of Contents (21 chapters)
Microsoft Exchange Server PowerShell Cookbook Third Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Setting internal and external CAS URLs


Each CAS server has multiple virtual directories, some of which can only be modified through the Exchange Management Shell. Scripting the changes made to both the internal and external URLs can be a big time-saver, especially when deploying multiple servers. In this recipe, you will learn how to use the set of cmdlets that are needed to modify both the internal and external URLs for each CAS server virtual directory.

How to do it...

To change the external URL of the OWA virtual directory of a server named cas1, use the following command:

Set-OwaVirtualDirectory -Identity 'CAS1\owa (Default Web Site)' `
-ExternalUrl https://mail.contoso.com/owa

After the change has been made, we can view the configuration using the Get-OwaVirtualDirectory cmdlet:

[PS] C:\>Get-OwaVirtualDirectory -Server cas1 | fl ExternalUrl
ExternalUrl : https://mail.contoso.com/owa

Note

Notice that if you change the URL for OWA, the ECP URL should be changed as well.

How it works.....