Difference between revisions of "Login to O365"

From MyWiki
Jump to: navigation, search
(Created page with "'''In Powershell load the Quest snapin'''<br> Add-PSSnapin Quest.ActiveRoles.ADManagement<br> $pw = read-host "Enter password" -AsSecureString<br> connect-QADService -service...")
 
 
Line 1: Line 1:
 
'''In Powershell load the Quest snapin'''<br>
 
'''In Powershell load the Quest snapin'''<br>
Add-PSSnapin Quest.ActiveRoles.ADManagement<br>
+
Import-Module MSOnline<br>
$pw = read-host "Enter password" -AsSecureString<br>
+
$O365Cred = Get-Credential<br>
connect-QADService -service 'dc02.example.com'-ConnectionAccount 'DOMAIN\useracc'-ConnectionPassword $pw<br>
+
$O365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection<br>
To disconnect at the end of session : Disconnect-QADService<br><br>
+
Import-PSSession $O365Session<br>
 +
Connect-MsolService -Credential $O365Cred<br>

Latest revision as of 11:06, 27 April 2015

In Powershell load the Quest snapin
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
Connect-MsolService -Credential $O365Cred