New-ManagementRole -Name MyDGCustom -Parent MyDistributionGroups in .NET Encode USS Code 39 in .NET New-ManagementRole -Name MyDGCustom -Parent MyDistributionGroups

New-ManagementRole -Name MyDGCustom -Parent MyDistributionGroups use .net vs 2010 code 3/9 integration toencode code39 with .net Microsoft Office Word Website After running .net vs 2010 Code 3 of 9 this command, we should now have a new role called MyDGCustom that contains all of the cmdlets that will allow the user to add and remove distribution groups. Using the following commands, we"ll remove those cmdlets from the role:.

Remove-Manage mentRoleEntry MyDGCustom\New-DistributionGroup Remove-ManagementRoleEntry MyDGCustom\Remove-DistributionGroup. This modifies .NET USS Code 39 the role so that only the cmdlets that can get, add, or remove distribution group members are available to the users. Finally, we can assign the custom role to the Default Role Assignment Policy, which, out of the box, is already applied to every mailbox in the organization:.

New-Managemen tRoleAssignment -Role MyDGCustom ` -Policy "Default Role Assignment Policy". Distribution .net framework barcode code39 Groups and Address Lists Now that this custom RBAC role has been implemented, we can simply add users to the ManagedBy property of any distribution group and they will be able to add members to and remove members from that group. However, they will be unable to delete the group, or create a new distribution group, which accomplishes the goal.

. See also Working with Code 3/9 for .NET Role Based Access Control (RBAC) in 10, Exchange Security Troubleshooting Role Based Access Control in 10, Exchange Security. Removing disabled user accounts from distribution groups A standard pr .NET Code39 actice amongst most organizations when users leave or have been let go is to disable their associated Active Directory user account. This allows an administrator to easily re-enable the account in the event that the user comes back to work, or if someone else needs access to the account.

Obviously, this has become a common practice because the process of restoring a deleted Active Directory user account is a much more complex alternative. Additionally, if these user accounts are left mailbox-enabled, you can end up with distribution groups that contain multiple disabled user accounts. This recipe will show you how to remove these disabled accounts using the Exchange Management Shell.

. How to do it... To remove dis Code 39 Extended for .NET abled Active Directory user accounts from all distribution groups in the organization, use the following code:. $groups = Get -DistributionGroup -ResultSize Unlimited foreach($group in $groups){ Get-DistributionGroupMember $group . {$_.Recipie .NET Code 3/9 ntType -like "*User*" -and $_.

ResourceType -eq $null} . Get-User {$_.UserAcc .net framework barcode 3/9 ountControl -match "AccountDisabled"} .

Remove-Distr ibutionGroupMember $group -Confirm:$false }. How it works... This code use s a foreach loop to iterate through each distribution group in the organization. As each group is processed, we retrieve only the members whose recipient type contains the word User. We"re also filtering out resource mailboxes as these are tied to disabled Active.

5 . Directory acc ounts. These filters will ensure that we only pipe objects with Active Directory user accounts down to the Get-User cmdlet, which will determine whether or not the account is disabled by checking the UserAccountControl property of each object. If the account is disabled, it will be removed from the group.

. There"s more Instead of pe rforming the remove operation, we can use a slightly modified version of the previous code to simply generate a report based on disabled Active Directory accounts that are members of a specific distribution group. Use the following code to generate this report:. $groups = Get 3 of 9 barcode for .NET -DistributionGroup -ResultSize Unlimited $report = foreach($group in $groups){ Get-DistributionGroupMember $group . {$_.Recipie ntType -like "*User*" -and $_.ResourceType -eq $null} .

Get-User {$_.UserAcc ountControl -match "AccountDisabled"} . Select-Object Name,RecipientType,@{n="Group";e={$group}} } $report Export-CSV c:\disabled_group_members.csv -NoType After running .net framework barcode 3/9 this code, a report will be generated using the specified file name that will list the disabled account name, Exchange recipient type, and associated distribution group for which it is a member..

See also Managing distribution groups in 3, Managing Recipients Working with distribution group naming policies Using group n .net vs 2010 bar code 39 aming policies, you can require that the distribution group names in your organization follow a specific naming standard. For instance, you can specify that all distribution group names are prefixed with a certain word and you can block certain words from being used within group names.

In this recipe, you"ll learn how to work with group naming policies from within the Exchange Management Shell..
Copyright © . All rights reserved.