Sunday, March 22, 2015

Removing the custom domain from Office 365 through PowerShell




The issue with removing the custom domain from Office 365 in GUI mode , 

below all the steps to install and connect PowerShell to Office 365:

Install:Microsoft Online Services Sign-In Assistant for IT Professionals RTW

And Windows Azure Active Directory Module for Windows PowerShell from the below link:
http://technet.microsoft.com/en-us/library/jj151815.aspx


2. Connect PowerShell to Office 365 using the next set of cmdlets:
 

 - Set-ExecutionPolicy RemoteSigned
 - Start-service winrm
 - import-module msonline
 - $LiveCred = Get-Credential
 - $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
 - $import = import-pssession $session
 - connect-msolservice -credential $livecred

3. I also added the cmdlet we used to remove the domain:



Remove-MsolDomain -DomainName -force





No comments: