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 6:15pm
What is your Exchange version?
Free Windows Admin Tool Kit Click here and download it now
January 7th, 2010 8: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 12:47pm
Hey, sorry about that, it regards Exchange 2007
Free Windows Admin Tool Kit Click here and download it now
January 8th, 2010 1:32pm
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 1:36pm
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 6:36pm
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 12:17pm
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 6:53pm
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:42am
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:12pm
Where do you list the users that need to be added? is it In $users?
July 4th, 2011 10:27am
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
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2011 6:07am
$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$_"})
July 11th, 2011 5:49pm