Exchange

How to List Members of a Dynamic Distribution Group

Dynamic Distribution Groups are a great feature of Exchange. You can easily use them to create a dynamic mail enabled group containing all of your users with mailboxes, or any other number of options. Since there is not a defined static list of members, it's slightly more difficult to get a list of all members. The two commands below, when ran from the Exchange Management Shell, will list all members of a Dynamic Distribution Group. These commands will work on any version of Exchange that support Dynamic Distribution Groups, including Exchange 2010, 2013, and 2016:

$e = Get-DynamicDistributionGroup "group@yourdomain.com"

Get-Recipient -RecipientPreviewFilter $e.RecipientFilter

It's important to note that a Dynamic Distribution Group, by it's very nature, is evaluated every time you query it, and could change from one query to another. 

How to Import a Mailbox or PST on Exchange 2010 When Receiving Error - This Mailbox Exceeded the Maximum Number of Corrupted Items That Were Specified for This Move Request

To import a PST file into a mailbox on Exchange 2010, you need to assign rights to a user account to import emails. Do so by running the following command (You can reference every command in this article with the links at the bottom):

New-ManagementRoleAssignment –Role “Mailbox Import Export” –User DOMAIN\Administrator

Run the following command on a mailbox server to import the PST (The share for -FilePath must have Read/Write permissions for the group Exchange Trusted Subsystem). While this example is for importing mail, the same rules apply for moving mailboxes using the New-MoveRequest command:

New-MailboxImportRequest -Mailbox <MailboxOrMailUserIdParameter> -FilePath "\\fileserver\usermail.pst"

By default, if there are any bad items in the PST, the import will fail with the following error message:

This mailbox exceeded the maximum number of corrupted items that were specified for this move request

To fix this, you must first remove the failed import request:

Get-MailboxImportRequest -Status Failed |  Remove-MailboxImportRequest

Add-MailboxPermission for Exchange 2010 SP1 /hosting - Give Full Access to Mailbox to Another User

If I remember correctly when /hosting came out you could use the Add-MailboxPermission as the domain administrator. It seems now with a later rollup [correct me if I'm wrong] you can no longer use this command because it gives you errors such as:

 The operation on mailbox "host.local/Microsoft Exchange Hosted Organizations/****/user01" failed because it's out of the current user's write scope. The object 'host.local/Microsoft Exchange Hosted Organizations/****/user01' must be within the read scope before and after it's modified. Can't perform the save operation.

    + CategoryInfo          : NotSpecified: (host.local/Micr...S/checkrequests:ADObjectId) [Add-MailboxPermission], TaskInvalidOperationException
    + FullyQualifiedErrorId :7F410251,Microsoft.Exchange.Management.RecipientTasks.AddMailboxPermission

   To fix this issue you must run the powershell as the organization administrator instead of the domain administrator.

Below is how you can accomplish this using remote powershell:

  • Launch Exchange Shell / Powershell
  • Run:

$c = Get-Credential

$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http:///powershell -Credential $c

Import-PSSession $session -AllowClobber

2003 to 2010 Migration - Can’t email 2003 users via outlook but can using OWA

During the migration to Exchange 2010 you might have the need to keep your Exchange 2003 server up and running. This is a supported configuration but sometimes you can run into problems even though everything is technically configured correctly.

In our case our send connectors and routing group connectors were perfectly fine. Yet people on Exchange 2010 couldn’t email Exchange 2003 users via Outlook. Now the stranger thing was they could using OWA.

Well the problem had to do with Event ID: 9667:

 

Event ID: 9667

Type: Error

Category: General

Source: msgidNamedPropsQuotaError

Description: Failed to create a new named property for database “” because the number of named properties reached the quota limit (). User attempting to create the named property: . Named property GUID: . Named property name/id: .

So to fix the problem we had to goto the registry key:

 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\Private-*************

Next we modify the registry value: NonMapi Named Props Quota

Change the value from 8192 to 16384

Now Dismount and remount the store

 

 

Cannot bind parameter ‘RecipientFilter’ to the target. Exception setting “RecipientFilter”

Full error:

Invoke-Command : Cannot bind parameter ‘RecipientFilter’ to the target. Exception setting “RecipientFilter”: “Invalid filter syntax. For a description of the filter parameter syntax see the command help.

“((UserPrincipalName -like ‘*@domain2.com’) -and (Alias -ne ))” at position 67.”

At *:39341 char:29

+ $scriptCmd = { & <<<< $script:InvokeCommand `

+ CategoryInfo : WriteError: (:) [Set-EmailAddressPolicy], ParameterBindingException

+ FullyQualifiedErrorId : ParameterBindingFailed, Microsoft.Exchange.Management.SystemConfigurationTasks.SetEmailAddressPolicy

 

This error is caused by an invalid syntax when setting the RecipientFilter. Normally when using powershell commands you will enclose everything in quotes. This is not the case with the RecipientFilter. You must put the value in-between curly braces { }.

Wrong:

  • -RecipientFilter "((UserPrincipalName -like '*@domain2.com') -and (Alias -ne $null))"

CORRECT:

  • -RecipientFilter {((UserPrincipalName -like '*@domain2.com') -and (Alias -ne $null))}

EmailAddressPolicy for Exchange 2010 /hosting [One organization, multiple primary domains]

 

If you are running Exchange 2010 in hosting mode then you will probably run across a client that wants everyone to be in the same organization so they can see everyone in the GAL, but also wants some users to have a primary domain that is different than others.

After messing with the ConditionalCompany and other Conditional fields I believe I found a better way to accomplish this without even having to mess with anything in Active Directory Users & Computers.

So the first thing you want to do is add the extra domain as an accepted domain:

  • New-AcceptedDomain -Name domain2.net  -DomainName domain2.net-Organization "My First Org"

Next you will want to create your email address policy. Instead of setting the conditional fields we are just going to set the RecipientFilter to something custom. Using the UserPrincipalName will allow us to apply this policy based on their UPN (also the accepted domain you just added).

  • New-EmailAddressPolicy -Organization ORGANIZATIONNAME -NameDOMAINNAME -EnabledEmailAddressTemplate SMTP:@NEWDOMAIN -RecipientFilter {((UserPrincipalName -like '*@NEWDOMAIN') -and (Alias -ne $null))}

Completed Example:

Exchange 9667 error in event log

During the migration to Exchange 2010 you might have the need to keep your Exchange 2003 server up and running. This is a supported configuration but sometimes you can run into problems even though everything is technically configured correctly.

In our case our send connectors and routing group connectors were perfectly fine. Yet people on Exchange 2010 couldn’t email Exchange 2003 users via Outlook. Now the stranger thing was they could using OWA.

Well the problem had to do with Event ID: 9667:

 

Event ID: 9667

Type: Error

Category: General

Source: msgidNamedPropsQuotaError

Description: Failed to create a new named property for database “” because the number of named properties reached the quota limit (). User attempting to create the named property: . Named property GUID: . Named property name/id: .

 

So to fix the problem we had to follow these steps:

  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\\Private-*************
  • Modify the following registry vaule: NonMAPI Named Props Quota
  • Change the value from 8192 to 16384
  • Dismount and remount the store

 

 

Removing an Organization (Remove-Organization)

 In order to remove an Organization from Exchange 2010 multi-tenant you must first delete all mailboxes from the organization. You can delete most of them through the ECP (Exchange Control Panel), but you will still be left with the administrator mailbox you are using, DiscoverySearchMailbox, and some others.

First you must find your organization you want to remove. You can do this by typing:

  • Get-Organization

Next you want to remove all mailboxes from the organization. Like I said above you can delete most of them using ECP or you can remove all the mailboxes quickly by typing:

  • Get-Mailbox-Organization"<ORG NAME HERE>"| Remove-Mailbox

Now that all mailboxes are removed you can type this to remove the organization: 

  • Remove-Organization -Identity "<ORG NAME HERE>"

Give it a minute and you should be able to do another Get-Organization and notice that your organization is gone! I took a picture for your viewing pleasure: 

remove-org

Exchange UM not submitting VM to Hub Transport servers

Today I was working with Exchange 2007 UM trying to get voice mails to work correctly. The problem I was having was weird because you could call the Exchange server, enter extensions, leave voice mails, but the voice mails would never actually get to the user nor would the user receive any emails about missing a call. Even calling into your mailbox to listen to your voice mails would tell you that you had none.

So I opened event viewer and found:

Event ID: 1082
The Unified Messaging server was unable to submit messages to a Hub Transport server because there is no Hub Transport server available to process the request with UM header file “%1″. Make sure that there is a Hub Transport server located in the same Active Directory site as the UM server. In addition, make sure that the Microsoft Exchange Transport service is started on the Hub Transport server.

and

Event ID: 1185
The Unified Messaging server was unable to submit a message to Hub Transport server “%1″ because the following error occurred: Unexpected SMTP server response. Expected: 220, actual: 500, whole response: 500 5.3.3 Unrecognized command.

 

 

Exchange 2010 SP1 Multi-Tenant (Step 2 of 3)

Creating New Organizations

Hosted Exchange uses “Service Plans” to control what organizations have access to what features. With service plans you can turn features on or off like POP, MAPI, ActiveSync, and even mailbox sizes. So open Windows Explorer and browse to:

c:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\ServicePlans

You will notice that there are sample service plans and CSV files called “ServicePlanHostingRemap”. It is very important you do not use the samples because they can be replaced with updates. Just simply copy a sample and rename it. Then open the HostingRemap file and put in something for the ProgramId and OfferId. The last one is for the name of the filename.

Service Plan

Next you will want to go to the Exchange Shell to create a new organization. So type:

 

  • $c = Get-Credential
  • New-Organization -Name "My Lab Domain" -DomainName labdomain.com -Location en-US -ProgramId Lab -OfferId 2 -AdministratorPassword $c.password

New Organization

 

 

The Parameters:

 

Pages

Subscribe to Exchange