lianne143
asked on
How to import email addresses from a distribution group to CSV
Hi
We use exchange 2007 and outlook 2010.We have two distribution list Staff and Students in exchange server.
Staff distribution contains 100 users and students distribution group contains 600 users.
I want to import both the staff and students names and mail addresses into a csv.
Is there a way of importing these email addresses .Please post me step by step tutorials.
Thanks
We use exchange 2007 and outlook 2010.We have two distribution list Staff and Students in exchange server.
Staff distribution contains 100 users and students distribution group contains 600 users.
I want to import both the staff and students names and mail addresses into a csv.
Is there a way of importing these email addresses .Please post me step by step tutorials.
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried entering the command and I am getting the following error.
EnabledPrimarySMTPAddressT emplate "@contoso.com"
[PS] C:\Windows\system32>Get-Di stribution GroupMembe r #Staff Team | sort Nam
e | % {
cmdlet Get-DistributionGroupMembe r at command pipeline position 1
Supply values for the following parameters:
Identity: If ($_.RecipientType -eq "UserMailbox")
Get-DistributionGroupMembe r : The operation could not be performed because
object ' If ($_.RecipientType -eq "UserMailbox")' could not be found on
domain controller 'DC-001.domain.local'.
At line:1 char:1
+ Get-DistributionGroupMembe r #Staff Team | sort Name | % {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
+ CategoryInfo : InvalidData: (:) [Get-DistributionGroupMemb er],
ManagementObjectNotFoundEx ception
+ FullyQualifiedErrorId : FDF89F70,Microsoft.Exchang e.Manageme nt.Recipie nt
Tasks.GetDistributionGroup Member
[PS] C:\Windows\system32>{
>> $_.Name + " (" + $_.PrimarySMTPAddress + ")" | Out-File c:\Import\members.txt
-Append
>> }
>> }
>>
EnabledPrimarySMTPAddressT
[PS] C:\Windows\system32>Get-Di
e | % {
cmdlet Get-DistributionGroupMembe
Supply values for the following parameters:
Identity: If ($_.RecipientType -eq "UserMailbox")
Get-DistributionGroupMembe
object ' If ($_.RecipientType -eq "UserMailbox")' could not be found on
domain controller 'DC-001.domain.local'.
At line:1 char:1
+ Get-DistributionGroupMembe
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Get-DistributionGroupMemb
ManagementObjectNotFoundEx
+ FullyQualifiedErrorId : FDF89F70,Microsoft.Exchang
Tasks.GetDistributionGroup
[PS] C:\Windows\system32>{
>> $_.Name + " (" + $_.PrimarySMTPAddress + ")" | Out-File c:\Import\members.txt
-Append
>> }
>> }
>>
ASKER
Please let me know if I am missing any thing
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I ran the following command and now I get the below.
[PS] C:\Windows\system32>Get-Di stribution Group -Anr StaffTeam
Name DisplayName GroupType PrimarySmtpAddress
---- ----------- --------- ------------------
StaffTeam StaffTeam Universal, Secur... StaffTeam@C...
[PS] C:\Windows\system32>
[PS] C:\Windows\system32>Get-Di
Name DisplayName GroupType PrimarySmtpAddress
---- ----------- --------- ------------------
StaffTeam StaffTeam Universal, Secur... StaffTeam@C...
[PS] C:\Windows\system32>
ASKER
Hi becraig
Please post me as how I go with next step
Thanks
Please post me as how I go with next step
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I saved the script as address.ps1 on C: and ran this from powershell ,please see below.
PS C:\> .\address.ps1
Get-DistributionGroupMembe r : The term 'Get-DistributionGroupMemb er' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At C:\address.ps1:1 char:1
+ Get-DistributionGroupMembe r StaffTeam | sort Name | % {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
+ CategoryInfo : ObjectNotFound: (Get-DistributionGroupMemb er:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\>
PS C:\> .\address.ps1
Get-DistributionGroupMembe
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At C:\address.ps1:1 char:1
+ Get-DistributionGroupMembe
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-DistributionGroupMemb
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi becraig
Thank you soo much for all your post. It worked like a charm.
Thank you soo much for all your post. It worked like a charm.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many thanks once again and I will give your points.
ASKER
Do I need to copy and run this command from exchange power shell replacing <group> with staff to get all the staff name and email address?