mrstrong Posted March 9, 2020 Posted March 9, 2020 We're on the free A1 plus office 365 and I need to to a bit of admin with powershell (calendar/mailbox/room permissions) What is the preferred/best method of connencting, I've found at least 3 ways so far e.g. Install-Module -Name AzureAD Install-Module MSOnline $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection (from https://docs.microsoft.com/en-us/office365/enterprise/powershell/connect-to-office-365-powershell https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps)
DaveTheTech Posted March 9, 2020 Posted March 9, 2020 I use Connect-MsolService Apparently AzureAD is the newer of the 2.
djm968 Posted March 9, 2020 Posted March 9, 2020 (edited) https://docs.microsoft.com/en-gb/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps Set-ExecutionPolicy RemoteSigned $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session -DisableNameChecking Edited March 9, 2020 by djm968
Danp Posted March 9, 2020 Posted March 9, 2020 https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?redirectedfrom=MSDN&view=exchange-ps
TechMonkey Posted March 9, 2020 Posted March 9, 2020 Using MFA with the account you want to connect or not?
mrstrong Posted March 11, 2020 Author Posted March 11, 2020 no not using MFA, went with https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps in the end Works ok but every few commands I get e.g. Creating a new session for implicit remoting of "Get-Mailbox" command... and then prompted by windows dialog box to enter password again (timeout issue?) which is quite annoying. Is this to be expected ?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now