AcceptMessagesOnlyFrom
Hello, I only need to add a user called "graig" in the AcceptMessagesOnlyFrom from the distributions lists starting by X_ That user should be then able to send as email to the DG starting by X_ Could you help me out?? Thanks Graig
January 7th, 2010 10:15am

What is your Exchange version?
Free Windows Admin Tool Kit Click here and download it now
January 7th, 2010 12:14pm

Set-DistributionGroup (RTM)http://technet.microsoft.com/en-us/library/bb629663(EXCHG.80).aspx Note: The AcceptMessagesOnlyFrom parameter specifies the mailbox users and mail-enabled contacts who can send e-mail messages to this distribution group. The AcceptMessagesOnlyFrom parameter can take any of the following values for the valid senders: Distinguished name (DN) Canonical name GUID Name Display name Alias Exchange DN Primary SMTP e-mail address By default, the value of this parameter is blank. This enables the distribution group to accept messages from all mailbox users and all mail-enabled contacts. Regards,Xiu<!---->
January 8th, 2010 4:47am

Hey, sorry about that, it regards Exchange 2007
Free Windows Admin Tool Kit Click here and download it now
January 8th, 2010 5:32am

Thanks Xiu, In fact, I did see that webpage, but could not manage to make the shell command work. Any idea how to apply the AcceptMessagesOnlyFrom for one user to distribution group starting by x_* ?? Thanks
January 8th, 2010 5:36am

Try this: Get-DistributionGroup -Filter {displayName -like "x*"} |Set-DistributionGroup -AcceptMessagesOnlyFrom "graig" -WhatIf Karl http://unlockpowershell.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
January 8th, 2010 10:36am

Hello Karl, Sorry for not getting back to u sooner. I tried the above shell command but I don't get my user added in the distribution group. I used the SamAccountName and tried with displayed name too. Thanks
January 14th, 2010 4:17am

The -WhatIf will prevent changes actually happening, but should show what change would be made.Remove the -WhatIf to actually make the change.Karlhttp://unlockpowershell.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
January 14th, 2010 10:53am

Hi I'm doing something very similar to this and i used your example, the only trouble is i'm trying to add multiple people to the acceptMessagesOnlyFrom but every time i use your code it just overwrites the previous name.. Is there a way to append onto the list of people who are listed in the acceptmessagesonlyfrom property????
June 30th, 2011 10:33am

Real quick untested code: foreach ($user in $users) { Get-DistributionGroup -Filter {displayName -like "x*"} |Set-DistributionGroup -AcceptMessagesOnlyFrom += $user } Karl http://unlockpowershell.wordpress.com Co-Author, Windows PowerShell 2.0 Bible -join("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})
Free Windows Admin Tool Kit Click here and download it now
June 30th, 2011 12:03pm

Hey Karl, I tried to use your code but an error came up saying that the parameter is null. i know i need to put the names of people in some where but i don;t know where
July 6th, 2011 6:04am

$users = import-csv userfile.csv or $users = "bob","john","burt" or $users = get-content usersfile.txt In other words, the variable $users is an array of users. Karlhttp://unlockpowershell.wordpress.com Co-Author, Windows PowerShell 2.0 Bible -join("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2011 5:46pm

For Exchange 2010 SP2 : There is a new feature: Get-DistributionGroup "DL-Test" | Set-DistributionGroup -AcceptMessagesOnlyFrom @{Add="User1"; Remove="User9","User10"} Source: MS Technet bb684908 regards Agtila
August 29th, 2012 10:00am

For Exchange 2010 SP2 : There is a new feature: Get-DistributionGroup "DL-Test" | Set-DistributionGroup -AcceptMessagesOnlyFrom @{Add="User1"; Remove="User9","User10"} Source: MS Technet bb684908 regards Agtila
Free Windows Admin Tool Kit Click here and download it now
August 29th, 2012 10:09am

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

Other recent topics Other recent topics