How to Connect to Exchange Online using remote PowerShell
Thank to: https://gcits.com/
If you’re going to be working with Office 365 via PowerShell, it’s a good idea to set up your computer with the appropriate PowerShell cmdlets and versions.
It’s also a good idea to create shortcuts to the various Office 365 services, so you can quickly log on to them without having to copy and paste commands one by one.
Here are some instructions on TechNet that detail the prerequisites for a connection to Exchange Online, though you might find you’ve got these installed already: https://technet.microsoft.com/en-us/library/jj984289(v=exchg.160).aspx
Easily connect to Exchange Online via PowerShell
Open PowerShell as an administrator
Go to Start, search for PowerShell, right click Windows Powershell and Run as Administrator
Create a PowerShell profile with a function
Run this:
1New-item
–type file –force
$profile
Then this:
1notepad
$profile
Now copy the following PowerShell function into the notepad document and save it:
(Be sure to replace elliot@gcits.com.au with your username).
1234567891011Function
Connect-EXOnline
{
$credentials
=
Get-Credential
-Credential
elliot
@gcits
.com.au
Write-Output
"Getting the Exchange Online cmdlets"
-ConfigurationName
Microsoft.Exchange
-Credential
$credentials
`
-Authentication
Basic
-AllowRedirection
Import-PSSession
$Session
}
Use the new function to connect quickly to Exchange Online
Close Powershell and run it again.
From now on you can just type Connect-ExOnline, or just type connect and press TAB.
Enter your password and you’re good to go.
Now your computer is set up to connect to Exchange Online without having to copy and paste multiple commands.
Comentarios
Publicar un comentario
Dime si la información de este blog te sirvio.