Mastering Office 365 Administration
上QQ阅读APP看书,第一时间看更新

Connecting to multiple services in a single session

If you have been paying close attention through the various subcomponents of Office 365, you may have observed that there is absolutely nothing that prevents us from connecting to all these services at the same time. This is useful, for example, if you need to make a change to mailboxes in Exchange Online based on information found in the Office 365 user's account, or if you want to add items to a SharePoint list based on the contents of a user's Outlook calendar. The possibilities are limitless.

Take exceptional care in circumstances where you need to connect to different services using different credentials, such as when copying data between two Office 365 tenants. Similarly, when you close one session and open another, you may need special code to handle the contingency of overriding commands that already exist due to a temporary PowerShell module created by a remote session. This is typically handled using the -NoClobber parameter, but you should be absolutely certain that you're connected to the session that you want to interact with.