Summary: When trying to assign the role to a user, you may encounter an error, such as “The term 'New-ManagementRoleAssignment' is not recognized.” In this post, you’ll get to know the procedure to troubleshoot this issue. Also, you’ll find about a third-party EDB converter software that can help export mailboxes if you face issues with your Exchange database.
Exchange Server works with Roles. You can assign a role to a user or group. These administrative roles can range from Mailbox Import Export to manage data in your Exchange Server, Compliance Journaling, Mail Tips, Mailbox Search, Information Rights Management, and more.
These roles can have a mix and match. You can create a role by using the Exchange Admin Center (EAC) or the Exchange Management Shell (EMS).
- Exchange Admin Center (EAC): To use the graphical user interface (GUI), you can do the following.
- Open a browser.
- Browse to https://yourexchangeserver/ecp.
- Log in with an Exchange Admin credentials.
- Click on Permissions.
- Click Admin Roles.
- Click on the + button.
- Give the Role group a name and click on the + button in the Roles section and select the different roles you want to assign to the group.
- Once done, click the Save button and the role group will be created.
- Exchange Management Shell (EMS): A lot of Exchange Administrators use PowerShell as it gives more control and flexibility over Exchange Servers. To assign roles using PowerShell, you need to use the below command:
- Open the Exchange Management Shell from the icon below.
- Once the PowerShell modules are loaded, enter the below command:
New-ManagementRoleAssignment -Role “Admin Role” -User Administrator
- Once this command is complete, the user will be assigned to the group. You can run the following command to confirm that the user has been assigned the role.
Get-ManagementRoleAssignment -Role “Admin Role”
Sometimes, you encounter an error, such as:
“The term ‘New-ManagementRoleAssignment’ 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:29
+ New-ManagementRoleAssignment <<<< -Role “Mailbox Import Export” -User Administrator
+ CategoryInfo : ObjectNotFound: (New-ManagementRoleAssignment:String) , CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
This happens when you try to assign the role to the user.
However, there are some troubleshooting procedures you can try to identify the issue. Here are the steps:
Step 1: Firstly, try to do the same procedure you did with the Exchange Management Shell (EMS) in the Exchange Admin Center (EAC). Check whether it works or not. Once you establish that through the interface it works, at least you have a workaround until the problem is fixed.
Step 2: The next thing to do is to check if the user running the command is using the modules. If you just open a PowerShell window, the commands of Exchange Server will not work, whether you open them as Administrator or not. For the Exchange Server commands to work, you will need to run them with the modules of Exchange Server loaded. These modules will give you access to the Exchange Server and open the commands for you to run.
When opening a standard PowerShell console, you will need to load the Active Directory PowerShell modules, along with the Exchange Server modules.
This can be done with the following commands:
Add-PSSnapIn -Name Microsoft.Exchange, Microsoft.Windows.AD
Step 3: After the above command is complete, you can try to run an Exchange Command to test that the modules have been loaded. For example, you can run a Get-Mailbox command, which normally lists all mailboxes.
Step 4: If this works, you can go ahead and run the New-ManagementRoleAssignment command. Another option would be to install the Exchange Management Tools on your computer. For this, you will need the media or installation ISO of the same Exchange Server installed in your infrastructure. You need to run the setup.exe file and in the role installation, choose the Management Tools (see the screenshot below).
This setup will install the Exchange Management Shell (EMS), along with all the required components.
To Wrap Up
The command may not work well due to an issue with the database where your user mailbox is set up. If the database is usable and it is mounted, it is suggested that you move all the mailboxes from the current database to a new one. If you have trouble doing so, you can use a third-party tool to facilitate the procedure.
Stellar Converter for EDB is the right tool for the job. It can open multiple EDB files at once and granularly export to PST and other file formats. You can use the application to export directly to a live Exchange Server mailbox database or Office 365 tenant.