In this webinar, our experts showcase a variety of demo use cases of how different components of the...
We've talked about using PowerShell to help manage your Office 365 environment. And although you can connect to Office 365 using the following commands (below), why not use something easier?
Import-Module MSOnline
$O365Cred = Get-Credential
$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session -AllowClobber
Connect-MsolService –Credential $O365Cred
There's a little thing called profiles. There are several locations where you can create profiles depending on your end goals.
Remember these profiles aren't created by default. They exist only if you create them.
Using Your Profile %UserProfile%DocumentsWindowsPowerShellMicrosoft.PowerShell_profile.ps1 to connect to office 365, create the Directory 'WindowsPowershell' and create the file 'Microsoft.PowerShell_profile.ps1':
Now, edit the file and add the lines of code mentioned above save the file:
Now every time you start up PowerShell, you will be prompted for your credentials and then automatically be logged into Office 365.
For more PowerShell tips and tricks, check out these resources:
Increase the CRM Activity Feed Follow Limit through PowerShell
Use PowerShell to Create Reports in Office 365
Managing Office 365 with PowerShell
Happy CRM'ing!
If you use something like:
Get-Credential | Export-Clixml -Path
just one time, you can avoid the credential prompt each time by changing
$O365Cred = Get-Credential
to
$O365Cred = Import-Clixml -Path
It's encrypted and very secure.