How to Transfer a Domain to Microsoft 365 Using Current PowerShell Tools
Question details
The user is attempting to transfer a domain to Microsoft 365 but is encountering errors because the provided PowerShell instructions rely on obsolete AzureRM and MSOnline modules.
- Product
- Microsoft 365
- Device & OS
- not provided
- Scenario
- Migrating a tenant or configuring a new environment by transferring an existing domain into Microsoft 365.
- Observed behavior
- The domain transfer is blocked by script failures related to the Login-AzureRmAccount command and uninitialized Azure PowerShell sessions.
Ensure you have global administrator access to your Microsoft 365 tenant and possess the domain transfer authorization code from your current domain registrar.
Use the Microsoft 365 Admin Center (GUI Method)
Bypass outdated PowerShell script errors by managing the domain transfer directly through the graphical user interface of the Microsoft 365 Admin Center.
Microsoft provides a robust admin center that simplifies domain management without the need to maintain or troubleshoot complex PowerShell environments. This is the most reliable method for adding and verifying domains.
Navigate to the Microsoft 365 admin center in your browser and log in with your global administrator credentials.
Go to 'Settings' in the left-hand navigation pane, then click on 'Domains'.
Click 'Add domain', enter your domain name, and follow the setup wizard to verify ownership by adding the required TXT or MX records to your DNS host.
Once verified, initiate the transfer at your domain registrar using your authorization code and update your nameservers to point to Microsoft 365.

Update to Current Az and Microsoft Graph Modules
If you require PowerShell for automation, you must abandon AzureRM and install the modern Az and Microsoft Graph PowerShell modules.
Looking for a cost-effective alternative to Microsoft 365?
While you manage your domain and tenant setup, consider outfitting your team with WPS Office. It provides a free, lightweight suite with full format compatibility and a familiar interface, reducing migration friction and software licensing costs.
- 1. Download the installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the suite: Run the downloaded installer and follow the quick setup wizard to install the software on your device.
- 3. Open your files: Launch WPS Office and immediately begin opening, editing, and saving your existing Microsoft Office documents.

Frequently Asked Questions
Why does the Login-AzureRmAccount command fail with an uninitialized session error?
The Login-AzureRmAccount command belongs to the deprecated AzureRM module. Microsoft has retired this module, causing newer environments to reject it. You must switch to the Connect-AzAccount command provided by the newer Az module.
How can I check which PowerShell modules are currently installed on my system?
Open your PowerShell terminal and run the command 'Get-Module -ListAvailable'. This will display a list of all installed modules, allowing you to verify if outdated modules like MSOnline or AzureRM are still present.
Can I complete a Microsoft 365 tenant migration entirely without PowerShell?
Yes. Most standard tenant migration tasks, including domain transfer, user creation, and license assignment, can be completed entirely through the graphical interface of the Microsoft 365 admin center.
What is the replacement for the obsolete MSOnline module?
Microsoft has replaced the MSOnline (Msol) module with the Microsoft Graph PowerShell SDK. You should use Microsoft Graph commands to automate tasks related to Azure Active Directory and Microsoft 365 user management.




