Type or paste these two lines in the PwerShell (in Administrator mode).Ĭonnect-ExchangeOnline -UserPrincipalName You'll need to load the ExchangeOnlineManagement using before using the script. (Windows PowerShell ISE has a scriipt pane at the top, which is useful if you want to edit the script. To use PowerShell scripts with Exchange online, start typing powershell on the start menu and open Windows PowerShell when it comes up. The primary Simple Mail Transfer Protocol (SMTP) address Returns the display name for the ExchangeUser object Returns olUser from the OlDisplayType representing the nature of the Returns olExchangeUserAddressEntry which represents the user type of The X400 e-mail address of the Exchange User See ExchangeUser members for the complete list. This table lists the fields that would contain data you might want to include in the export. Write-host "Check your spelling, the DL was not found" # get the members but only select certain columns - export the results to a csv file # Save the distribution member details as csv in the user's documents directory # if the name of the distribution group was entered correctly then $NF will still be null # Add the DL name to the code or enter it when you run the script You can add the group name in the code or type it in when you run the PowerShell. If you only need the members of one distribution group, this PowerShell exports each member's name, email address, and alias in a specific distribution group to a CSV file. # get the members & select columns, export to a csv file $exportfile = $HOME + '\Documents\' + $DL + '_Members.csv' # Save as csv in the user's documents directory Get-DistributionGroupMember -Identity $DL | Select-Object DisplayName, PrimarySmtpAddress, ExternalEmailAddress, Alias | Export-Csv -Path $exportfile (A list of available field names is below.) If you need more fields, add them to this line in the code. This PowerShell creates a CSV file for every DL in the organization, containing each member's name, email address, and alias. PowerShell will allow you to export one or more lists and get any field available in the GAL entry. If you need to export the distribution group from Outlook, see Use VBA to Create a List of Exchange GAL Members for a VBA version. The methods on this page require Exchange admin access. The drawback: you need to export one distribution group at a time and the fields you see are what you get. The values shown on the screen are downloaded. Under Bulk Operations, select Download members. Select the distribution group you want to export.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |