How to Connect to Office 365 via PowerShell

This article explains How to Connect to Office 365 via PowerShell. There are lot of things you can do from the Portal, however for most of the tasks, you’ll need PowerShell. Please be sure to use it carefully as its a powerful tool, and can do a lot more than you can imagine. To login to Office 365 via Azure PowerShell, it’s advised to install the latest version of PowerShell. Prerequisite for Azure PowerShell is Microsoft Online Sign-in Assistant. You can download it from here. You can install this on Windows 8, Windows 8.1, Windows 7 (SP1)*, Windows Server 2008 R2 (SP1)* * You’ll need to install Microsoft .NET 4.5 framework or above along with Windows Management Framework 3.0 or above. Please click to know how to install .NET Framework 4.0 and Windows Management Framework 4.0 You can download the Azure PowerShell from the links below: Windows Azure Active Directory Module for Windows PowerShell (32-bit version) Windows Azure Active Directory Module for Windows PowerShell (64-bit version) Install the Sign-in Assistant, and Azure Active Directory Module, and launch Windows Azure PowerShell as Administrator (ensure that you Run it as Administrator) Run the following commands to connect with your Office 365 account: Set-ExecutionPolicy = unrestricted $cred = Get-Credential -Credential $user Enter the credentials for your Office 365 Admin account and hit OK. Import-Module MSOnline Connect-MsolService -Credential $cred $msoExchangeURL = “https://ps.outlook.com/powershell/” $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $msoExchangeURL -Credential $cred -Authentication Basic -AllowRedirection Import-PSSession $session Now you are connected to Office 365 via PowerShell. Please do not forget to share your feedback, or ask us a question by clicking here. Follow...

Http Error 503 with Office 365 ADFS sign in page

Follow me Issue description: We had a working ADFS server farm serving production office 365 single sign on environment for one of our clients. Suddently users reported that they are at times getting  Office 365 login was given error “HTTP Error 503” while redirecting to ADFS page. Before that there were some issues with authentication of some outlook and Mobil clients as well however it was again sporadic. Environment: We had a Two windows 2008 R2 server installed with the latest version of  ADFS from O365 behind a hardware Load Balancer and along with that the usual Active directory domain infrastructure with over 20 domain controllers. It was quite evident that the issue is with ADFS server as, first there were no other issues reported inside the orgnization and second we were seeing Http Error 503 every now and then, which was definitely atleast starting from ADFS server. Hence, To Begin troubleshooting the issue, its best to try and isolate the cause by individually trying to sign into both the server internally, the one which gives the issue is causing the problem.  like this https://<ADFS server 1>/adfs/ls/IdpInitiatedSignon.aspx https:// <ADFS server 2>/adfs/ls/IdpInitiatedSignon.aspx If one of the server gives error like “HTTP Error 503”,problem with that server. As an immidiate solution we can try to remove it from the load balancer by the time we resolve the issue, so that external users do not run into this server causing the error   We started to look around to find the issue and not too later we found that ADFSAppPool was down on one of the server, started it to resolve the issue...