Error when executing get-rolegroup

PROBLEM :

When I execute get-rolegroup I get the following error:

The requested search root ‘forest.local/Microsoft Exchange Security Groups’ is not within the scope of this operation. C
annot perform searches outside the scope ‘domain.forest.local’.
+ CategoryInfo          : NotSpecified: (0:Int32) [Get-RoleGroup], ADOperationException
+ FullyQualifiedErrorId : C13C766,Microsoft.Exchange.Management.RbacTasks.GetRoleGroup

SOLUTION :

By default Exchange Management Console and Exchange Management Shell has the recipient scope in same domain where Exchange server or Exchange Management tools installed computer.

Change the Recipient Scope
http://technet.microsoft.com/en-us/library/bb124527.aspx

We may need to change the scope to the entire forest.

Try this first : Set-AdServerSettings -ViewEntireForest $True

If not try this : Set-AdServerSettings -ViewEntireForest $True -PreferredGlobalCatalog Your Primary Global Catalog

You can aslo try this command : Get-RoleGroup -ReadFromDomainController “Primary GC FQDN”

This is what you should get  :

get-rolegroup | fw

Organization Management                    Public Folder Management
Recipient Management                       View-Only Organization Management
UM Management                              Help Desk
Records Management                         Discovery Management
Server Management                          Delegated Setup