You cannot export those directly, as the output is returned as Display Names only. You can try "matching" those against the corresponding object, but since Display Name is not an unique attribute, you will end up with ambiguous results.
Exporting DLs AcceptMessagesOnlyFromSendersOrMembers members UPNs
Need help in Exporting EXO DLs AcceptMessagesOnlyFromSendersOrMembers members UPNs
Exchange | Exchange Server | Management
5 answers
Sort by: Most helpful
-
Vasil Michev 119.7K Reputation points MVP Volunteer Moderator
2020-07-29T17:13:05.303+00:00 -
Ranjit Singh 31 Reputation points
2020-07-29T17:35:12.397+00:00 thats a big challenge. Why i need because we are in the process of creating On prem DLs in Cloud. We want to create them exact copy of on prem DLs, any help you can provide here...
-
KyleXu-MSFT 26,396 Reputation points
2020-07-30T01:48:05.813+00:00 You can use command below to get the accept list and convert them to PrimarySmtpAddress:
(Get-DistributionGroup GroupName).AcceptMessagesOnlyFromSendersOrMembers | Get-Recipient | fl Name,PrimarySmtpAddress
-
Ranjit Singh 31 Reputation points
2020-07-30T04:04:22.35+00:00 Hi Thanks for your response.
My requirement is as follows:- I have DL Alias names in excel sheet in csv file, so want to pipe this file while fetching below details.
- I want to export DL Alias names, and DL AcceptMessagesOnlyFromSendersOrMembers members list with UPNs.
Ones, i have above details, i can create DLs in Cloud and use this information to update DLs with "Authorised Senders" details.
Thanks.
-
KyleXu-MSFT 26,396 Reputation points
2020-07-30T08:06:40.67+00:00 Firstly, I need to said, Q&A forum doesn't supported write scripts according to needs so far. We could help modify some script which write by your, but don't supported writing script directly. If you have this kind of demand later, you may need to post it in "stack overflow" forum or open a ticket to Microsoft.
Here are a script writing by me which may be useful to you:
$groups = Import-Csv d:/temp/groups.csv foreach ($group in $groups){ $name = $group.name $temp = (Get-DistributionGroup $name).AcceptMessagesOnlyFromSendersOrMembers | Get-Recipient | select GroupName,Name,PrimarySmtpAddress foreach ($item in $temp) { $item.GroupName = $name } $temp }
1.Prepare a csv file as picture below:
2.Using script below to get detailed information for those group:
If you want to export the result, you could add ">>location" when running this script: