Quantcast
Channel: Exchange Server 2013 - General Discussion forum
Viewing all articles
Browse latest Browse all 13303

Script to remove all of the management entries of a role

$
0
0

Hi all,

I want to remove all of the role entries of a custom management role. For example, I create a role:
New-ManagementRole -Name 'test1' -Parent 'Mail Recipients'

Then, I want to remove all of the role entries in this role. Here is what I tried:
Get-ManagementRoleEntry "test1\*" | Remove-ManagementRoleEntry
I got the following error message:
======================

Cannot process argument transformation on parameter 'Identity'. Cannot convert value "test1" to type "Microsoft.Exchange.Configuration.Tasks.RoleEntryIdParameter". Error: "The format of the value you specified in the Microsoft.Exchange.Configuration.Tasks.RoleEntryIdParameter parameter isn't valid. Check the value, and then try again.
Parameter name: identity"
    + CategoryInfo          : InvalidData: (test1:PSObject) [Remove-ManagementRoleEntry], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Remove-ManagementRoleEntry

=========================

Can someone help about the PowerShell script to achieve the goal?

PS1: It's in Exchange 2013 (I remember I encountered the same issue in 2010)
PS2: I don't have enough permissions. In other words, I cannot create a unscopedtoplevel management role. What I can do is to remove all of the role entries in the children role.

TIA 


Viewing all articles
Browse latest Browse all 13303

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>