Connect to O365 exchange with powershell using session import

By Tom Kitching

It seems fairly obvious but a lot of people are unsure how to import a remote powershell session to O365. Simply do the following: [cc lang=”powershell”]$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session[/cc]

Search through previous powershell commands with grep

By admin

It can be really difficult trying to remember that command you used a few weeks ago in Powershell.  Here’s an easy way to search through your previous commands to find the right one and jog your memory. First, run [cc lang=”powershell”](Get-PSReadlineOption).HistorySavePath C:\Users\username\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt[/cc] Then you can cat the output to look for the command [cc lang=”powershell”]cat…