You are migrating mailboxes from Exchange on-premises to Exchange Online in Microsoft 365. This time…
How to fix Get-OfflineAddressBook is not recognized
You want to get the Offline Address Book with Exchange Online PowerShell. But, the following error appears: Get-OfflineAddressBook is not recognized as the name of a cmdlet. In this article, you will learn why this is happening and the solution to Get-OfflineAddressBook is not recognized.
Table of contents
Get-OfflineAddressBook is not recognized
After we Connect to Exchange Online PowerShell and run the Get-OfflineAddressBook cmdlet, the error appears:
Get-OfflineAddressBook : The term ‘Get-OfflineAddressBook’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\> Get-OfflineAddressBook
Get-OfflineAddressBook : The term 'Get-OfflineAddressBook' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-OfflineAddressBook
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-OfflineAddressBook:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Why is this happening and what is the solution?
Solution to Get-OfflineAddressBook is not recognized
The solution to this error is adding the Address Lists role to the Organization Management role group.
In Exchange Online, this Get-OfflineAddressBook cmdlet is available only in the Address Lists role, and by default, the role isn’t assigned to any role groups. To use this cmdlet, you need to add the Address Lists role to a role group (for example, to the Organization Management role group).
Assign Address Lists role in Microsoft 365 admin center
To add the Address Lists role to the Organization Management role group, follow these steps:
- Sign in to Microsoft 365 admin center
- Expand Roles and click on Role assignments
- Click on Exchange in the top bar
- Choose Organization Management from the list
- Click on Permissions
- Select the Address Lists role
- Click Save
Assign Address Lists role with PowerShell
To assign the Address Lists role to the Organization Management role group with PowerShell, run the New-ManagementRoleAssignment cmdlet.
PS C:\> New-ManagementRoleAssignment -SecurityGroup "Organization Management" -Role "Address Lists"
Get the role assignments for the Organization Management role group.
PS C:\> (Get-RoleGroup "Organization Management").RoleAssignments | Sort-Object
The output needs to show the Address Lists-Organization Management role.
Verify Get-OfflineAddressBook works
Let’s verify that the Get-OfflineAddressBook cmdlet works.
Note: Wait an hour before you try and run the Get-OfflineAddressBook cmdlet. That’s because it takes time to propagate the changes on Microsoft’s cloud servers.
1. Run the Disconnect-ExchangeOnline cmdlet and close the PowerShell window.
PS C:\> Disconnect-ExchangeOnline
2. Start Windows PowerShell as administrator and Connect to Exchange Online PowerShell.
PS C:\> Connect-ExchangeOnline
3. Run the Get-OfflineAddressBook cmdlet.
PS C:\> Get-OfflineAddressBook
Name Versions AddressLists
---- -------- ------------
Default Offline Address Book {Version4} {\Offline Global Address List}
It’s a success!
Read more: Import PST to Office 365 »
Conclusion
You learned how to fix Get-OfflineAddressBook is not recognized error. The solution to this problem is adding the Address Lists role to the Organization Management role group. After that, you can run the command Get-OfflineAddressBook in PowerShell and get the information.
Did you enjoy this article? You may also like Renew Client Secret in Microsoft Entra ID. Don’t forget to follow us and share this article.
This Post Has 0 Comments