Lync 2013 management role assignment set-managementroleassignment

Ok so this shouldn’t come up too often, but if you run the exchange script configure-enterprisepartnerapplication.ps1 too often, and then remove any aspect of lync from AD, then you get a disassociate of the role group user assignment. I used the following to “match” the name of the objects to get-ManagementRoleAssignment and then just delete all the assignments. So the configure-enterprisepartnership.ps1 would not work until all the assignments were gone. Ugh!

Get-ManagementRoleAssignment | ?{$_.Name -imatch “-1-2-3-4”} | ft name,role -a

Get-ManagementRoleAssignment | ?{$_.Name -imatch “-1-2-3-4”} | Remove-ManagementRoleAssignment

The idea is to search for the assignments that are missing and then remove the assignemnrts. the assumptions is the object user, rolegroup etc… has been removed already. See the screen shots.

userrolegroupassignment

As an after thought, I thought of another way to query for the role by identity,  Get-ManagementRoleAssignment -identity ArchiveApplication* | ft name

So the are several ways to query for these, but it is handy to have a couple of examples in case you have to clean these out.

L

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s