To manage mail, calendar and native move collection members you can use the following cmdlets:
|
TIP:
- You can use CSV file to add or remove multiple collection members. Refer to the instruction on how to generate CSV file for this operation.
- You can use -ForceMove switch to force adding members to the collection even in case these members were included in another collection. These members will be removed from another collection and will added to the specified one (move operation).
|
Get-MMExCollectionMember
Returns members (mailboxes, groups, containers) of all collections or of filtered collections specified by its name, type or ID. If no parameters specified all members of all collections will be returned. The following properties are returned, if applicable:
- Source Organization Name
- Target Organization Name
- Collection Name
- Collection Type <Mail | Calendar | NativeMove>
- Name <Alias for Group|DN for Container| Alias for Mailbox>
- Type <Group | Container | Mailbox >
- SMTP <PrimarySmtpAddress>
The Get-MMExCollectionMember cmdlet has the following syntax:
Get-MMExCollectionMember [-CollectionName <collection name>] -CollectionType <Mail, Calendar or NativeMove> [-SourceOrganization <Source organization name>] [-TargetOrganization <Target organization name> [<CommonParameters>]
-OR-
Get-MMExCollectionMember [-CollectionId <collection ID>] [<CommonParameters>]
You can use CollectionId to identify the collection instead of collection name, type, source and target organization. This is recommended for the cases where collection names differ by case only to identify the collection uniquely.
|
IMPORTANT: Command will be aborted in case the unique collection cannot be found using specified parameters. |
Parameters
-CollectionId
Optional named parameter. Contains collection identifier.
-CollectionName
Optional named parameter. Contains case-insensitive collection name.
-CollectionType
Optional named parameter. Contains collection type. Currently the following values are supported: 'Mail', 'Calendar', 'NativeMove'.
-SourceOrganization
Optional named parameter. Contains case-sensitive source organization name.
-TargetOrganization
Optional named parameter. Contains case-sensitive target organization name.
Examples:
Get-MMexCollectionMember -CollectionName 'c1'
Returns members of filtered collection(s) with name 'c1'
Remove-MMExCollectionMember
The Remove-MMExCollectionMember cmdlet removes the member specified using member type and member identity from the collection specified using collection identifier or collection name, collection type, source organization name, and target organization name.
The Remove-MMExCollectionMember cmdlet has the following syntax:
Remove-MMExCollectionMember [-CollectionId <Collection ID>] -MemberIdentity <member identity> -MemberType <member type> [<CommonParameters>]
-OR-
Remove-MMExCollectionMember [-SourceOrganization <source organization name>][-TargetOrganization <target organization name>][-CollectionName <collection name>] -CollectionType <collection type> -MemberIdentity <member identity> -MemberType <member type> [<CommonParameters>]
|
IMPORTANT: Command will be aborted in case the unique collection cannot be found using specified parameters. No members will be deleted. |
Parameters
-CollectionId
Optional named parameter. Contains collection identifier.
-CollectionName
Optional named parameter. Contains case-insensitive collection name.
-CollectionType
Optional named parameter. Contains collection type. Currently the following values are supported: 'Mail', 'Calendar', 'NativeMove'.
- Calendar for a calendar collection
- NativeMove for a NativeMove collection
- Mail for a mailbox collection
-SourceOrganization
Optional named parameter. Contains case-sensitive source organization name.
-TargetOrganization
Optional named parameter. Contains case-sensitive target organization name.
-MemberType
Required. Contains case-insensitive member type. Currently the following values are supported: 'Mailbox', 'Group', 'Container'.
-MemberIdentity
Required. Contains case-insensitive member identity. For 'Mailbox' and 'Group' member type alias is used as the member identity, for 'Container' member type distinguished name is used as the member identity.
Examples:
Remove-MMExCollectionMember -CollectionId 1 -MemberIdentity Mbx1 -MemberType Mailbox
Removes mailbox with name Mbx1 from collection with identifier 1
Remove-MMExCollectionMember -CollectionId 1 -MemberIdentity G1 -MemberType Group
Removes group with name G1 from collection with identifier 1
Remove-MMExCollectionMember -CollectionId 1 -MemberIdentity ‘cn=MigratedMbxs,dc=domain‘ -MemberType Container
Removes container cn=MigratedMbxs,dc=domain from collection with identifier 1
Remove-MMExCollectionMember -SourceOrganization Exchange2k13 - TargetOrganization 0365 -CollectionType Mail -CollectionName 'c1' -MemberIdentity G1 -MemberType Group
Removes the group with name G1 from the mail collection C1 created for the migration from Exchange2k13 organization to O365 organization.
Get-MMExCollectionMember | Remove-MMExCollectionMember
Removes all members in all collections
Import-Csv -Path "C:\members.csv"| Remove-MMExCollectionMember
Removes members specified in a csv file. You can generate CSV file as described below.
To get comma-separated file for this operation you can use the following command:
Get-MMExCollectionMember |Export-Csv c:\members.csv "SourceOrganization","TargetOrganization","CollectionName","CollectionType","MemberIdentity","MemberType","SMTP"
CSV file example:
"Limbo Organization","Nasri Organization","M1","Mail","limbo_02","Mailbox","limbo_02@limbo.amazon.dmm"
"Limbo Organization","Nasri Organization","M1","Mail","limbo_03","Mailbox","limbo_03@limbo.amazon.dmm"
"Limbo Organization","Nasri Organization","Mail_limbo_01","Mail","limbo_01","Mailbox","limbo_01@limbo.amazon.dmm"
"Limbo Organization","Nasri Organization","Mail_Limbo_04 (Sync wrong watermarks)","Mail","limbo_04","Mailbox","limbo_04@limbo.amazon.dmm"
To create the file manually include the following parameters:
- SourceOrganization
- TargetOrganization
- CollectionName
- CollectionType
- MemberIdentity (for the collection member to remove)
- Member Type (for the collection member to remove)
Pay attention, SMTP is not used for the procedure and can be omitted.
Add-MMExCollectionMember
|
IMPORTANT:
|
The Add-MMExCollectionMember cmdlet adds the member specified using member type and member identity to the collection specified using collection identifier or collection name, collection type, source organization name, and target organization name.
The Add-MMExCollectionMember cmdlet has the following syntax:
Add-MMExCollectionMember [-SourceOrganization <source organization name>][-TargetOrganization <target organization name>] [-CollectionName <collection name>] -CollectionType <collection type> -MemberIdentity <member identity> -MemberType <member type> [-ForceMove] [<CommonParameters>]
-OR-
Add-MMExCollectionMember [-CollectionId <Collection ID>] -MemberIdentity <member identity> -MemberType <member type> [-ForceMove] [<CommonParameters>]
|
IMPORTANT: Command will be aborted in case the unique collection cannot be found using specified parameters. No members will be added. |
Parameters
-CollectionId
Optional named parameter. Contains collection identifier.
-CollectionName
Optional named parameter. Contains case-insensitive collection name.
-CollectionType
Optional named parameter.. Contains collection type. Currently the following values are supported: 'Mail', 'Calendar', 'NativeMove'.
- Calendar for a calendar collection
- NativeMove for a NativeMove collection
- Mail for a mailbox collection
-SourceOrganization
Optional named parameter. Contains case-sensitive source organization name.
-TargetOrganization
Optional named parameter. Contains case-sensitive target organization name.
-MemberType
Required. Contains case-insensitive member type. Currently the following values are supported: 'Mailbox', 'Group', 'Container'.
-MemberIdentity
Required. Contains case-insensitive member identity. For 'Mailbox' and 'Group' member type alias is used as the member identity, for 'Container' member type distinguished name is used as the member identity.
-ForceMove
You can use -ForceMove switch to force adding members to the collection even in case these members are included in another collection. These members will be removed from another collection and will added to the specified one (move operation). In case this switch is not used you will be prompted to decide if the existing member should be moved. All new members will be added to the specified collection automatically.
Examples:
Add-MMexCollectionMember -CollectionId 1 -MemberType Mailbox -MemberIdentity user@org.com
Adds mailbox 'user@org.com' to the collection with identifier 1.
Add-MMexCollectionMember -CollectionId 1 -MemberType Mailbox -MemberIdentity user@org.com
Adds mailbox 'user@org.com' to the collection with identifier 1.
Add-MMexCollectionMember -CollectionId 1 -MemberType Group -MemberIdentity grpA
Adds group ‘grpA’ to the collection with identifier 1.
Add-MMexCollectionMember -CollectionId 1 -MemberType Container -MemberIdentity Users
Adds container ‘Users’ to the collection with identifier 1.
Import-Csv -Path "C:\members.csv"| Add-MMExCollectionMember
Adds members specified in a csv file. You can generate CSV file as described above.
To validate members that should be added to the collection using Add-MMExCollectionMember cmdlet, the administrative account specified in Add Source Organization wizard should be granted the following additional permissions:
- Permissions required to add mailboxes:
- View-Only Recipients management role
- View-Only Configuration management role
- Permissions required to add groups and containers:
- Read access to the source domain
- PowerShell Remoting access to the source forest
These additional permissions should be granted only in case you are planning to use using Add-MMExCollectionMember cmdlet.
Granting View-Only Recipients and View-Only Configuration management roles
New-ManagementRoleAssignment -Role "View-Only Configuration" -User "source\mmex_svc"
New-ManagementRoleAssignment -Role "View-Only Recipients" -User "source\mmex_svc"
Granting PowerShell Remoting access to the source forest
For Windows Server 2008 and later
By default, only domain administrators are allowed to use remote PowerShell. If services account does not belong to domain administrators group, administrator should perform the following actions at a Domain Controller:
- Execute in PowerShell to access Permissions configuration UI:
Set-PSSessionConfiguration -Name Microsoft.PowerShell -showSecurityDescriptorUI
Do the following in Permissions configuration UI:
- Add service account to the list
- Set Read(Get,Enumerate,Subscribe) and Execute(Invoke) permission to Allow for service account
- Save changes and exit
- Restart WinRM service
For Windows Server 2012 and later
Security group "Remote Management Users" has been introduced in Windows Server 2012. Users belonging to it are allowed to use the default session configuration to create new PowerShell sessions. This also grants the user access to WMI resources over management protocols (such as WS-Management) on the machine where you added the user to Remote Management Users.
- Add the MMEx service account to the "Remote Management Users" group