Update-recipient

I have one GAL which is syncing through Ms Forefront Identity Management. I am facing issue that some contact are there is the Global Address list but we are not be able to send email to them. I came to know that Legacy Exchange Attribute X500 is missing for these users.

Now I want to update all the recipient

but when I try the command

Get-MailContact  | Update-Recipient

IT is doing only for 1000 users how

Can some share the command to increase the size and also get the logs.

Regards,

September 7th, 2015 7:10am

Run get-mailcontact -resultsize unlimited | update-recipient 

-resultsize unlimited indicates it can get result for infinity

Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 7:44am

get-mailcontact -resultsize Unlimited | update-recipient c:\logs.csv will give the logs also

are we can get the logs also

  
September 7th, 2015 7:45am

get-mailcontact -resultsize Unlimited | update-recipient -verbose | export-csv c:\logs.csv 

use -verbose and export-csv

Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 7:53am

Hi,

We cannot export the verbose information to log with export-csv command or other method.

Why do you want the verbose information?

If you want to check if the update-recipient command executes successfully. We can search administrator audit log and export the result.

Search-AdminAuditLog -Cmdlets "update-recipient" | export-csv C:\log.csv

Best Regards.

September 8th, 2015 12:15am

[PS] C:\Windows\system32>Get-MailContact -ResultSize unlimited -OrganizationalUnit "TEST.COM/GALS/contacts" -Filter { L
egacyExchangeDN -eq $null } | Set-MailContact
 The following validation errors happened: WARNING: The property value is invalid.
The value can't contain leading or trailing whitespace. Sending data to a remote command failed with the following error message:
 The data in the command exceeded the maximumsize that is allowed by the session configuration. The allowed maximum is 500 MB. Change the input,
use a differentsession configuration, or change the "PSMaximumReceivedObjectSizeMB" and
"PSMaximumReceivedDataSizePerCommandMB"properties of the session configuration on the remote computer.
For more information, see theabout_Remote_Troubleshooting Help topic.+ CategoryInfo        
 : OperationStopped: (SERVER1.TEST.COM:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : JobFailure
    + PSComputerName        : SERVER1.TEST.COM

HOW CAN TO FIGURE OUT THIS

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 2:34am

Hi,

What's value you want to change using Set-MailContact ?

And about the error: The data in the command exceeded the maximumsize that is allowed by the session configuration. The allowed maximum is 500 MB. Change the input, two methods.

1. Break down the query like this KB

https://support.microsoft.com/en-us/kb/2922668

2. Create a new PSSessionConfiguration (this to not use the default one) in your remote computer:

Register-PSSessionConfiguration -Name DataNoLimits

Then configuring the parameter you want (in this case MaximumReceivedDataSizePerCommandMB and MaximumReceivedObjectSizeMB):

Set-PSSessionConfiguration -Name DataNoLimits -MaximumReceivedDataSizePerCommandMB 800 -MaximumReceivedObjectSizeMB 800

Then create the new session with the PSSessionConfiguration you need:

$Session = New-PSSession -ComputerName MyRemoteComp -ConfigurationName DataNoLimits

Best Regards.

September 8th, 2015 2:57am

Register-PSSessionConfiguration -Name DataNoLimits

Set-PSSessionConfiguration -Name DataNoLimits -MaximumReceivedDataSizePerCommandMB 8000 -MaximumReceivedObjectSizeMB 8000

$Session = New-PSSession -ComputerName MyRemoteComp -ConfigurationName DataNoLimits

[PS] C:\Windows\system32>Get-MailContact -ResultSize unlimited -OrganizationalUnit "test.com/GALS/contacts" -Filter { L
egacyExchangeDN -eq $null } | Set-MailContact
Sending data to a remote command failed with the following error message: The total data received from the remote
client exceeded the allowed maximum. The allowed maximum is 524288000. For more information, see the
about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OperationStopped: (Server1.test.com:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : JobFailure
    + PSComputerName        : Server1.test.com

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 3:40am

how can I filter it with

{$_.DisplayName -match "^[A-F]"}

in the above command

September 8th, 2015 3:46am

Hi,

We can filter it like this:

Get-MailContact -ResultSize unlimited -OrganizationalUnit "test.com/GALS/contacts" -Filter {LegacyExchangeDN -eq $null } | ? {$_.DisplayName -match "^[A-F]"}

Best Regards.

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 5:06am

Actually I want to update-recipient for all the contact that are in my GAL There are more than 40k users. how can we run this command to update all the contacts
September 8th, 2015 11:34pm

Hi,

Try running these commands one by one.

Get-MailContact -ResultSize unlimited -OrganizationalUnit "test.com/GALS/contacts" -Filter {LegacyExchangeDN -eq $null } | ? {$_.DisplayName -match "^[A-D]"} | Update-Recipient

Get-MailContact -ResultSize unlimited -OrganizationalUnit "test.com/GALS/contacts" -Filter {LegacyExchangeDN -eq $null } | ? {$_.DisplayName -match "^[E-H]"}| Update-Recipient

Get-MailContact -ResultSize unlimited -OrganizationalUnit "test.com/GALS/contacts" -Filter {LegacyExchangeDN -eq $null } | ? {$_.DisplayName -match "^[I-L]"} | Update-Recipient

Get-MailContact -ResultSize unlimited -OrganizationalUnit "test.com/GALS/contacts" -Filter {LegacyExchangeDN -eq $null } | ? {$_.DisplayName -match "^[M-P]"} | Update-Recipient

Get-MailContact -ResultSize unlimited -OrganizationalUnit "test.com/GALS/contacts" -Filter {LegacyExchangeDN -eq $null } | ? {$_.DisplayName -match "^[Q-T]"} | Update-Recipient

Get-MailContact -ResultSize unlimited -OrganizationalUnit "test.com/GALS/contacts" -Filter {LegacyExchangeDN -eq $null } | ? {$_.DisplayName -match "^[U-X]"} | Update-Recipient

Get-MailContact -ResultSize unlimited -OrganizationalUnit "test.com/GALS/contacts" -Filter {LegacyExchangeDN -eq $null } | ? {$_.DisplayName -match "^[Y-Z]"} | Update-Recipient

Then update this GAL.

Update-GlobalAddressList -Identity "GAL"

Best Regards.


Free Windows Admin Tool Kit Click here and download it now
September 9th, 2015 2:48am

I have external contacts also that is coming from other OPCOs. How can I update those contacts.

normally I am updating them individually

update-recipient abc@xyz.com

September 9th, 2015 11:11pm

How can we run update-recipient for external contact for bulk contacts
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 2:27am

Hi,

Do you mean the all external contact for domain @xyz.com?

If yes, try this

Get-mailcontact | ? {$_.Emailaddresses -match "@xyz.com"} | update-recipient

Best Regards.

September 11th, 2015 2:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics