Managing SharePoint with PowerShell Core
Since Exchange is managed through a remote session, the commands are simply issued from the PowerShell Core instance but executed on the remote machine (the Office 365 remote connection that we set up with New-PSSession
).
The following script is very similar to the connection script in Chapter 5, Managing Exchange Online Using PowerShell. To showcase how we can combine Unix and PowerShell commands, we pipe the results of the Get-User
command to a file and then use the cat
command to show the contents of the result.txt
file on the screen:
Last login: Sat Jul 15 16:34:48 2017 from martinp7.localdomain [psuser@centos7B ~]$ powershell PowerShell v6.0.0-beta.4 Copyright (C) Microsoft Corporation. All rights reserved. PS /home/psuser> $creds = Get-Credential # prompt user for credentials Windows PowerShell credential request Enter your credentials. User: [email protected] Password for user [email protected]: ***********...