ajdratch
asked on
Export Distribution lists from exchange to Office 365
I am trying to find a powershell script to export all distribution lists from on-premise Exchange 2010 and import them into Office 365. I want to keep these as distribution list, I do not want to convert them to groups.
Is there a way to do this?
Is there a way to do this?
It takes several steps. This website has a really good description of the steps and some PowerShell assist: http://blogs.catapultsystems.com/thernandez/archive/2015/09/16/migrate-distribution-groups-from-exchange-on-premise-to-exchange-online/
ajdratch-
Are you in a hybrid scenario?
If so your distribution groups are also showing up already in o365. If that is the case and you want to create all your dls directly on o365- we 1. Pull all the info for the dls and their members, then 2. move the dls to an OU that doesn't sync with o365 so they will disappear from o365
Create a folder named Temp on your c: drive
1. You want to pull all the distributiongroups getting their names,displayname alias,and smtp address
Get-DistributionGroup -ResultSize Unlimited | Select Name,DisplayName,Alias,Pri marySmtpAd dress,Mana gedBy | Export-csv 'c:\temp\o365grps.csv' -notypeinformation
2. Now you want to get all group members of these distributiongroups from the .csv we just created
Import-Csv 'c:\temp\o365grps.csv' | %{$name=$_.Name; Get-DistributionGroupMembe r $_.Name | Select PrimarySmtpAddress | Export-csv 'c:\temp\$name.csv' -notypeinformation}
If in a hybrid scenario- now move all your on premise dls to an OU that is not syncing with o365. Wait until you don't see your dls in o365 anymore now recreate the dls in the following steps.
Log in to o365 via powershell- run the following command to create all your dls back
Import-Csv 'c:\temp\o365grps.csv' | %{New-DistributionGroup -Name $_.Name -DisplayName $_.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySMTPAddress -ManagedBy $_.managedby}
We now have all the groups created in o365 so now we need to add the members back to the groups
*Remember- all the groupmembers have been exported to .csv files matching the group Name*
2 options-
a)- add the groupmembers back with a command doing them one by one
Import-csv "C:\temp\oneofthgroupsname .csv" | %{Add-DistributionGroupMem ber nameofgroupthatcorresponds withthecsv -member $_.PrimarysmtpAddress}
OR
We bulk add all the members to all the dls with the below steps and powershell command
1. Go to the .csv c:\temp\o365grps.csv and a create another header named Path
2. In each Row that has a group name input the path to where the .csv that contains the groupmembers is located
example DistributionGroup1 now has all the groupmembers in the .csv c:\temp\DistributionGroup1 .csv
You will put c:\temp\DistributionGroup1 .csv in the path column for that DistributionGroup. Set the path for all your groupmembers for their Distribution groups.
Now put the below in a notepad, save it to c:\temp as Addo365members.ps1
$csv = import-csv 'c:\temp\o365grps.csv'
foreach ($c in $csv) {
Import-csv $c.path | %{Add-DistributionGroupMem ber $c.name -Member $_.PrimarySmtpAddress}
}
cd to c:temp then type .\Addo365members.ps1 press enter
All your dls will now populate with their members
Are you in a hybrid scenario?
If so your distribution groups are also showing up already in o365. If that is the case and you want to create all your dls directly on o365- we 1. Pull all the info for the dls and their members, then 2. move the dls to an OU that doesn't sync with o365 so they will disappear from o365
Create a folder named Temp on your c: drive
1. You want to pull all the distributiongroups getting their names,displayname alias,and smtp address
Get-DistributionGroup -ResultSize Unlimited | Select Name,DisplayName,Alias,Pri
2. Now you want to get all group members of these distributiongroups from the .csv we just created
Import-Csv 'c:\temp\o365grps.csv' | %{$name=$_.Name; Get-DistributionGroupMembe
If in a hybrid scenario- now move all your on premise dls to an OU that is not syncing with o365. Wait until you don't see your dls in o365 anymore now recreate the dls in the following steps.
Log in to o365 via powershell- run the following command to create all your dls back
Import-Csv 'c:\temp\o365grps.csv' | %{New-DistributionGroup -Name $_.Name -DisplayName $_.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySMTPAddress -ManagedBy $_.managedby}
We now have all the groups created in o365 so now we need to add the members back to the groups
*Remember- all the groupmembers have been exported to .csv files matching the group Name*
2 options-
a)- add the groupmembers back with a command doing them one by one
Import-csv "C:\temp\oneofthgroupsname
OR
We bulk add all the members to all the dls with the below steps and powershell command
1. Go to the .csv c:\temp\o365grps.csv and a create another header named Path
2. In each Row that has a group name input the path to where the .csv that contains the groupmembers is located
example DistributionGroup1 now has all the groupmembers in the .csv c:\temp\DistributionGroup1
You will put c:\temp\DistributionGroup1
Now put the below in a notepad, save it to c:\temp as Addo365members.ps1
$csv = import-csv 'c:\temp\o365grps.csv'
foreach ($c in $csv) {
Import-csv $c.path | %{Add-DistributionGroupMem
}
cd to c:temp then type .\Addo365members.ps1 press enter
All your dls will now populate with their members
ASKER
I am not in hybrid mode. I saw the link that Michael sent but it lost me at the beginning of step two "Clean file from export 1"
It says to Create “NEW” values. Insert columns after the following (Name, Alias, DisplayName, PrimarySmtpAddress), and prefix column header with “NEW” by using following formula.
I created the new column headings by typing them in. I did not use a formula
It then says to "copy the formula down through data, so that all data is prefixed with "NEW." I am not sure what I am supposed to do here since I don't have a formula to use. I'm not sure what is supposed to be in the fields under the NEW columns that i created.
It says to Create “NEW” values. Insert columns after the following (Name, Alias, DisplayName, PrimarySmtpAddress), and prefix column header with “NEW” by using following formula.
I created the new column headings by typing them in. I did not use a formula
It then says to "copy the formula down through data, so that all data is prefixed with "NEW." I am not sure what I am supposed to do here since I don't have a formula to use. I'm not sure what is supposed to be in the fields under the NEW columns that i created.
Fair enough if you are not in a hybrid mode then follow my steps. You don't have to worry about moving the on prem dls to an OU that is not syncing.
ASKER
I am using the directory E:\DistributionExport. In step 2 I run
Import-Csv 'E:\DistributionExport\o36 5grps.csv' | %{$name=$_.Name; Get-DistributionGroupMembe r $_.Name | Select PrimarySmtpAddress | Export-csv 'E:\DistributionExport\$na me.csv' -notypeinformation}
The $name.csv file is empty
Import-Csv 'E:\DistributionExport\o36
The $name.csv file is empty
Is your file o365grps.csv populated with info?
ASKER
Yes, all five columns are populated
When you did the export >Export-csv 'E:\DistributionExport\$na me.csv' -notypeinformation}< It should have made .csv files with the names of your distribution groups. These .csv files will contain your groupmembers. It did not create any .csv files?
The syntax may have needed a few spaces for the name area, try the below
Import-Csv 'E:\DistributionExport\o36 5grps.csv' | %{$name = $_.Name; Get-DistributionGroupMembe r $_.Name | Select PrimarySmtpAddress | Export-csv 'E:\DistributionExport\$na me.csv' -notypeinformation}
Import-Csv 'E:\DistributionExport\o36
ASKER
Got the same result. The file $name.csv gets created however it is empty - zero bytes
Fair enough let's pick a different field
Import-Csv 'E:\DistributionExport\o36 5grps.csv' | %{$Alias = $_.Alias; Get-DistributionGroupMembe r $_.Alias | Select PrimarySmtpAddress | Export-csv 'E:\DistributionExport\$Al ias.csv' -notypeinformation}
Import-Csv 'E:\DistributionExport\o36
ASKER
Same thing. The file $Alias,csv was created but zero bytes
I've used that so many times without issue. Let's try it another way.
Import-Csv 'E:\DistributionExport\o36 5grps.csv' | %{Get-DistributionGroupMem ber $_.Name | Select PrimarySmtpAddress | Export-csv 'E:\DistributionExport\$_. name.csv' -notypeinformation}
Import-Csv 'E:\DistributionExport\o36
ASKER
Same results. The file is created but it is zero bytes.
Let's test on one group- Get the Name or alias of one of the groups
Get-DistributionGroupMembe r 'inputnameoraliasofgroup' | Select PrimarySmtpAddress | Export-csv 'E:\DistributionExport\inp utnameoral iasofgroup .csv' -notypeinformation
Were you running the command on prem Exchange?
Get-DistributionGroupMembe
Were you running the command on prem Exchange?
ASKER
That did work. I have a list of PrimarySmtpAddress for the one distribution group
Please send a screenshot of one complete row from your .csv o365grps. with the headers...top row is sufficient...with the headers
ASKER
Screenshot is attached
Capture.JPG
Capture.JPG
The .csv you have looks good. Are you running the command in on prem Exchange management Shell?
Import-csv 'E:\DistributionExport\o36 5grps.csv' | %{ $name = $_.Name; Get-DistributionGroupMembe r $_.Name | Select PrimarySmtpAddress | Export-csv "E:\DistributionExport\$na me.csv" -notypeinformation }
Import-csv 'E:\DistributionExport\o36
ASKER
I am running it on the on-premise Exchange server. I ran the script you just posted and it created a file for each distribution group with the members
Finally
Ok now that you have pulled the information for the groups and its members...log in to o365 via powershelll and let's create all your groups at one time.
Import-Csv 'E:\DistributionExport\o36 5grps.csv' | %{New-DistributionGroup -Name $_.Name -DisplayName $_.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySMTPAddress -ManagedBy $_.managedby}
Import-Csv 'E:\DistributionExport\o36
ASKER
I'm getting this error for each file
Couldn't find object
"Microsoft.Exchange.Data.D irectory.A DMultiValu edProperty `1[Microso ft.Exchang e.Data.Dir ectory.ADO bjectId]". Please make
sure that it was spelled correctly or specify a different object.
+ CategoryInfo : NotSpecified: (:) [], ManagementObjectNotFoundEx ception
+ FullyQualifiedErrorId : [Server=BLUPR16MB0450,Requ estId=320c 9f90-b533- 42f7-a225- 50f16adbbf a4,TimeSta mp=10/14/2 01
8 8:41:50 PM] [FailureCategory=Cmdlet-Ma nagementOb jectNotFou ndExceptio n] 289573BB
+ PSComputerName : outlook.office365.com
Couldn't find object
"Microsoft.Exchange.Data.D
sure that it was spelled correctly or specify a different object.
+ CategoryInfo : NotSpecified: (:) [], ManagementObjectNotFoundEx
+ FullyQualifiedErrorId : [Server=BLUPR16MB0450,Requ
8 8:41:50 PM] [FailureCategory=Cmdlet-Ma
+ PSComputerName : outlook.office365.com
Please connect to Exchange online with the instructions in the following link
https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps
https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps
ASKER
When I run the command Import-PSSession $Session -DisableNameChecking I get the following output
Import-PSSession : No command proxies have been created, because all of the requested remote commands would shadow
existing local commands. Use the AllowClobber parameter if you want to shadow existing local commands.
At line:1 char:1
+ Import-PSSession $Session -DisableNameChecking
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Import-PSSession], ArgumentException
+ FullyQualifiedErrorId : ErrorNoCommandsImportedBec auseOfSkip ping,Micro soft.Power Shell.Comm ands.Impor tPSSession Co
mmand
Import-PSSession : No command proxies have been created, because all of the requested remote commands would shadow
existing local commands. Use the AllowClobber parameter if you want to shadow existing local commands.
At line:1 char:1
+ Import-PSSession $Session -DisableNameChecking
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Import-PSSession], ArgumentException
+ FullyQualifiedErrorId : ErrorNoCommandsImportedBec
mmand
Copy the below to notepad and save in the folder of your choice as o365connect.ps1
$UserCredential = Get-Credential
Connect-MsolService -Credential $UserCredential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/?proxyMethod=RPS -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Then cd to the folder and type in .\o365connect.ps1 and press enter
$UserCredential = Get-Credential
Connect-MsolService -Credential $UserCredential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/?proxyMethod=RPS -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Then cd to the folder and type in .\o365connect.ps1 and press enter
ASKER
This is the entire error after that runs. I did copy all the files to a computer that has Windows Azure powershell. That is why the folder is d:\temp\dl
WARNING: Proxy creation has been skipped for the following command: 'Add-AvailabilityAddressSp ace,
Add-DistributionGroupMembe r, Add-MailboxFolderPermissio n, Add-MailboxLocation, Add-MailboxPermission,
Add-ManagementRoleEntry, Add-PublicFolderClientPerm ission, Add-RecipientPermission, Add-RoleGroupMember,
Add-UnifiedGroupLinks, Approve-ElevatedAccessRequ est, Clear-ActiveSyncDevice, Clear-MobileDevice,
Clear-TextMessagingAccount , Compare-TextMessagingVerif icationCod e, Complete-MigrationBatch,
ConvertFrom-ExoJobData.ps1 , Delete-QuarantineMessage, Deny-ElevatedAccessRequest , Disable-AntiPhishRule, Disable-App,
Disable-HostedContentFilte rRule, Disable-InboxRule, Disable-JournalArchiving, Disable-JournalRule, Disable-Mailbox,
Disable-MailPublicFolder, Disable-MalwareFilterRule, Disable-OutlookProtectionR ule, Disable-SweepRule,
Disable-TransportRule, Disable-UMAutoAttendant, Disable-UMCallAnsweringRul e, Disable-UMIPGateway, Disable-UMMailbox,
Enable-AntiPhishRule, Enable-App, Enable-HostedContentFilter Rule, Enable-InboxRule, Enable-JournalRule,
Enable-Mailbox, Enable-MailPublicFolder, Enable-MalwareFilterRule, Enable-OrganizationCustomi zation,
Enable-OutlookProtectionRu le, Enable-SweepRule, Enable-TransportRule, Enable-UMAutoAttendant,
Enable-UMCallAnsweringRule , Enable-UMIPGateway, Enable-UMMailbox, Export-MailboxDiagnosticLo gs,
Export-MigrationReport, Export-QuarantineMessage, Export-TransportRuleCollec tion, Export-UMCallDataRecord,
Export-UMPrompt, Get-AcceptedDomain, Get-ActiveSyncDevice, Get-ActiveSyncDeviceAccess Rule, Get-ActiveSyncDeviceClass,
Get-ActiveSyncDeviceStatis tics, Get-ActiveSyncMailboxPolic y, Get-ActiveSyncOrganization Settings,
Get-AddressBookPolicy, Get-AdminAuditLogConfig, Get-AdministrativeUnit, Get-AdvancedThreatProtecti onDocument Detail,
Get-AdvancedThreatProtecti onDocument Report, Get-AntiPhishPolicy, Get-AntiPhishRule, Get-App,
Get-ApplicationAccessPolic y, Get-ATPTotalTrafficReport, Get-AuditConfig, Get-AuditConfigurationPoli cy,
Get-AuditConfigurationRule , Get-AuditLogSearch, Get-AuthServer, Get-AvailabilityAddressSpa ce, Get-AvailabilityConfig,
Get-BlockedSenderAddress, Get-CalendarDiagnosticAnal ysis, Get-CalendarDiagnosticLog, Get-CalendarDiagnosticObje cts,
Get-CalendarNotification, Get-CalendarProcessing, Get-CalendarViewDiagnostic s, Get-CASMailbox, Get-CASMailboxPlan,
Get-ClientAccessRule, Get-Clutter, Get-CompliancePolicyFileSy ncNotifica tion, Get-CompliancePolicySyncNo tification ,
Get-ComplianceTag, Get-ComplianceTagStorage, Get-ConnectionByClientType DetailRepo rt, Get-ConnectionByClientType Report,
Get-ConnectSubscription, Get-Contact, Get-CsActiveUserReport, Get-CsAVConferenceTimeRepo rt,
Get-CsClientDeviceDetailRe port, Get-CsClientDeviceReport, Get-CsConferenceReport, Get-CsP2PAVTimeReport,
Get-CsP2PSessionReport, Get-CsPSTNConferenceTimeRe port, Get-CsPSTNUsageDetailRepor t, Get-CsUserActivitiesReport ,
Get-CsUsersBlockedReport, Get-DataEncryptionPolicy, Get-DataRetentionReport, Get-DeviceComplianceDetail sReport,
Get-DeviceComplianceDetail sReportFil ter, Get-DeviceCompliancePolicy Inventory, Get-DeviceComplianceReport Date,
Get-DeviceComplianceSummar yReport, Get-DeviceComplianceUserIn ventory, Get-DeviceComplianceUserRe port,
Get-DeviceConditionalAcces sPolicy, Get-DeviceConditionalAcces sRule, Get-DeviceConfigurationPol icy,
Get-DeviceConfigurationRul e, Get-DevicePolicy, Get-DeviceTenantPolicy, Get-DeviceTenantRule, Get-DistributionGroup,
Get-DistributionGroupMembe r, Get-DkimSigningConfig, Get-DlpKeywordDictionary,
Get-DlpSensitiveInformatio nTypeRuleP ackage, Get-DlpSiDetectionsReport, Get-DynamicDistributionGro up,
Get-ElevatedAccessApproval Policy, Get-ElevatedAccessAuthoriz ation, Get-ElevatedAccessRequest,
Get-EligibleDistributionGr oupForMigr ation, Get-EmailAddressPolicy, Get-FailedContentIndexDocu ments,
Get-FederatedOrganizationI dentifier, Get-FederationInformation, Get-FederationTrust, Get-FfoMigrationReport,
Get-FocusedInbox, Get-Group, Get-GroupActivityReport, Get-GroupMailbox, Get-HistoricalSearch,
Get-HostedConnectionFilter Policy, Get-HostedContentFilterPol icy, Get-HostedContentFilterRul e,
Get-HostedOutboundSpamFilt erPolicy, Get-HotmailSubscription, Get-HybridMailflow, Get-HybridMailflowDatacent erIPs,
Get-ImapSubscription, Get-InboundConnector, Get-InboxRule, Get-IntraOrganizationConfi guration,
Get-IntraOrganizationConne ctor, Get-IRMConfiguration, Get-JournalRule, Get-LicenseVsUsageSummaryR eport,
Get-LinkedUser, Get-LogonStatistics, Get-Mailbox, Get-MailboxActivityReport, Get-MailboxAuditBypassAsso ciation,
Get-MailboxAutoReplyConfig uration, Get-MailboxCalendarConfigu ration, Get-MailboxCalendarFolder, Get-MailboxFolder,
Get-MailboxFolderPermissio n, Get-MailboxFolderStatistic s, Get-MailboxJunkEmailConfig uration, Get-MailboxLocation,
Get-MailboxMessageConfigur ation, Get-MailboxOverrideConfigu ration, Get-MailboxPermission, Get-MailboxPlan,
Get-MailboxPreferredLocati on, Get-MailboxRegionalConfigu ration, Get-MailboxRestoreRequest,
Get-MailboxRestoreRequestS tatistics, Get-MailboxSearch, Get-MailboxSpellingConfigu ration, Get-MailboxStatistics,
Get-MailboxUsageDetailRepo rt, Get-MailboxUsageReport, Get-MailboxUserConfigurati on, Get-MailContact,
Get-MailDetailATPReport, Get-MailDetailMalwareRepor t, Get-MailDetailReport, Get-MailDetailSpamReport,
Get-MailDetailTransportRul eReport, Get-MailFilterListReport, Get-MailPublicFolder, Get-MailTrafficATPReport,
Get-MailTrafficPolicyRepor t, Get-MailTrafficReport, Get-MailTrafficSummaryRepo rt, Get-MailTrafficTopReport,
Get-MailUser, Get-MalwareFilterPolicy, Get-MalwareFilterRule, Get-ManagementRole, Get-ManagementRoleAssignme nt,
Get-ManagementRoleEntry, Get-ManagementScope, Get-MessageCategory, Get-MessageClassification, Get-MessageRecallResult,
Get-MessageTrace, Get-MessageTraceDetail, Get-MessageTrackingReport, Get-MigrationBatch, Get-MigrationConfig,
Get-MigrationEndpoint, Get-MigrationStatistics, Get-MigrationUser, Get-MigrationUserStatistic s, Get-MobileDevice,
Get-MobileDeviceDashboardS ummaryRepo rt, Get-MobileDeviceMailboxPol icy, Get-MobileDeviceStatistics , Get-MoveRequest,
Get-MoveRequestStatistics, Get-MxRecordReport, Get-MxRecordsReport, Get-Notification,
Get-O365ClientBrowserDetai lReport, Get-O365ClientBrowserRepor t, Get-O365ClientOSDetailRepo rt, Get-O365ClientOSReport,
Get-OMEConfiguration, Get-OMEMessageStatus, Get-OnlineMeetingConfigura tion, Get-OnPremisesOrganization ,
Get-OrganizationalUnit, Get-OrganizationConfig, Get-OrganizationRelationsh ip, Get-OutboundConnector,
Get-OutboundConnectorRepor t, Get-OutlookProtectionRule, Get-OwaMailboxPolicy, Get-PartnerApplication,
Get-PartnerCustomerUserRep ort, Get-PerimeterConfig, Get-PerimeterMessageTrace, Get-PhishFilterPolicy, Get-Place,
Get-PopSubscription, Get-PublicFolder, Get-PublicFolderClientPerm ission, Get-PublicFolderItemStatis tics,
Get-PublicFolderMailboxDia gnostics, Get-PublicFolderMailboxMig rationRequ est,
Get-PublicFolderMailboxMig rationRequ estStatist ics, Get-PublicFolderMigrationR equest,
Get-PublicFolderMigrationR equestStat istics, Get-PublicFolderStatistics , Get-QuarantineMessage,
Get-QuarantineMessageHeade r, Get-RbacDiagnosticInfo, Get-Recipient, Get-RecipientPermission,
Get-RecipientStatisticsRep ort, Get-RemoteDomain, Get-ReportExecutionInstanc e, Get-ReportSchedule,
Get-ReportScheduleList, Get-ResourceConfig, Get-RetentionEvent, Get-RetentionPolicy, Get-RetentionPolicyTag,
Get-RMSTemplate, Get-RMSTrustedPublishingDo main, Get-RoleAssignmentPolicy, Get-RoleGroup, Get-RoleGroupMember,
Get-SCInsights, Get-ScorecardClientDeviceR eport, Get-ScorecardClientOSRepor t, Get-ScorecardClientOutlook Report,
Get-ScorecardMetricsReport , Get-SearchDocumentFormat, Get-SecurityPrincipal, Get-SendAddress, Get-SenderPermission,
Get-ServiceDeliveryReport, Get-ServiceStatus, Get-SharingPolicy, Get-SiteMailbox, Get-SiteMailboxDiagnostics ,
Get-SiteMailboxProvisionin gPolicy, Get-SmimeConfig, Get-SPOActiveUserReport, Get-SpoofMailReport,
Get-SPOSkyDriveProDeployed Report, Get-SPOSkyDriveProStorageR eport, Get-SPOTeamSiteDeployedRep ort,
Get-SPOTeamSiteStorageRepo rt, Get-SPOTenantStorageMetric Report, Get-StaleMailboxDetailRepo rt, Get-StaleMailboxReport,
Get-Subscription, Get-SupervisoryReviewPolic yReport, Get-SupervisoryReviewPolic yV2, Get-SupervisoryReviewRepor t,
Get-SupervisoryReviewRule, Get-SweepRule, Get-SyncConfig, Get-SyncRequest, Get-SyncRequestStatistics,
Get-TextMessagingAccount, Get-ToolInformation, Get-TransportConfig, Get-TransportRule, Get-TransportRuleAction,
Get-TransportRulePredicate , Get-UMAutoAttendant, Get-UMCallAnsweringRule, Get-UMCallDataRecord,
Get-UMCallSummaryReport, Get-UMDialPlan, Get-UMHuntGroup, Get-UMIPGateway, Get-UMMailbox, Get-UMMailboxConfiguration ,
Get-UMMailboxPIN, Get-UMMailboxPlan, Get-UMMailboxPolicy, Get-UMPhoneSession, Get-UnifiedAuditSetting,
Get-UnifiedGroup, Get-UnifiedGroupLinks, Get-User, Get-UserPhoto, Import-ContactList, Import-RecipientDataProper ty,
Import-RMSTrustedPublishin gDomain, Import-TransportRuleCollec tion, Import-UMPrompt, New-ActiveSyncDeviceAccess Rule,
New-ActiveSyncMailboxPolic y, New-AdminAuditLogSearch, New-AntiPhishPolicy, New-AntiPhishRule, New-App,
New-ApplicationAccessPolic y, New-AvailabilityConfig, New-ClientAccessRule, New-CompliancePolicySyncNo tification ,
New-ConnectSubscription, New-DistributionGroup, New-DkimSigningConfig, New-DynamicDistributionGro up,
New-ElevatedAccessRequest, New-EmailAddressPolicy, New-HostedConnectionFilter Policy, New-HostedContentFilterPol icy,
New-HostedContentFilterRul e, New-HotmailSubscription, New-ImapSubscription, New-InboundConnector, New-InboxRule,
New-IntraOrganizationConne ctor, New-JournalRule, New-Mailbox, New-MailboxAuditLogSearch, New-MailboxFolder,
New-MailboxRestoreRequest, New-MailboxSearch, New-MailContact, New-MailMessage, New-MailUser, New-MalwareFilterPolicy,
New-MalwareFilterRule, New-ManagementRole, New-ManagementRoleAssignme nt, New-ManagementScope,
New-MessageClassification, New-MigrationBatch, New-MigrationEndpoint, New-MobileDeviceMailboxPol icy, New-MoveRequest,
New-OnPremisesOrganization , New-OrganizationRelationsh ip, New-OutboundConnector, New-OutlookProtectionRule,
New-OwaMailboxPolicy, New-PartnerApplication, New-PopSubscription, New-PrivilegedIdentityMana gementRequ est,
New-ProtectionServicePolic y, New-PublicFolder, New-PublicFolderMigrationR equest, New-RemoteDomain, New-ReportSchedule,
New-RetentionPolicy, New-RetentionPolicyTag, New-RoleAssignmentPolicy, New-RoleGroup, New-SchedulingMailbox,
New-SharingPolicy, New-SiteMailbox, New-SiteMailboxProvisionin gPolicy, New-Subscription, New-SweepRule,
New-SyncMailPublicFolder, New-SyncRequest, New-TransportRule, New-UMAutoAttendant, New-UMCallAnsweringRule,
New-UMDialPlan, New-UMHuntGroup, New-UMIPGateway, New-UMMailboxPolicy, New-UnifiedGroup, Preview-QuarantineMessage,
Release-QuarantineMessage, Remove-ActiveSyncDevice, Remove-ActiveSyncDeviceAcc essRule, Remove-ActiveSyncMailboxPo licy,
Remove-AntiPhishPolicy, Remove-AntiPhishRule, Remove-App, Remove-ApplicationAccessPo licy,
Remove-AuditConfigurationP olicy, Remove-AuditConfigurationR ule, Remove-AuditStubFolder,
Remove-AvailabilityAddress Space, Remove-AvailabilityConfig, Remove-BlockedSenderAddres s, Remove-CalendarEvents,
Remove-ClientAccessRule, Remove-CompliancePolicyFil eSyncNotif ication, Remove-CompliancePolicySyn cNotificat ion,
Remove-ConnectSubscription , Remove-DistributionGroup, Remove-DistributionGroupMe mber, Remove-DynamicDistribution Group,
Remove-EmailAddressPolicy, Remove-HostedConnectionFil terPolicy, Remove-HostedContentFilter Policy,
Remove-HostedContentFilter Rule, Remove-HybridConfiguration , Remove-InboundConnector, Remove-InboxRule,
Remove-IntraOrganizationCo nnector, Remove-JournalRule, Remove-Mailbox, Remove-MailboxFolderPermis sion,
Remove-MailboxLocation, Remove-MailboxPermission, Remove-MailboxRestoreReque st, Remove-MailboxSearch,
Remove-MailboxUserConfigur ation, Remove-MailContact, Remove-MailUser, Remove-MalwareFilterPolicy ,
Remove-MalwareFilterRule, Remove-ManagementRole, Remove-ManagementRoleAssig nment, Remove-ManagementRoleEntry ,
Remove-ManagementScope, Remove-MessageClassificati on, Remove-MigrationBatch, Remove-MigrationEndpoint,
Remove-MigrationUser, Remove-MobileDevice, Remove-MobileDeviceMailbox Policy, Remove-MoveRequest,
Remove-OnPremisesOrganizat ion, Remove-OrganizationRelatio nship, Remove-OutboundConnector,
Remove-OutlookProtectionRu le, Remove-OwaMailboxPolicy, Remove-PartnerApplication, Remove-PublicFolder,
Remove-PublicFolderClientP ermission, Remove-PublicFolderMigrati onRequest, Remove-RecipientPermission ,
Remove-RemoteDomain, Remove-ReportSchedule, Remove-RetentionPolicy, Remove-RetentionPolicyTag,
Remove-RMSTrustedPublishin gDomain, Remove-RoleAssignmentPolic y, Remove-RoleGroup, Remove-RoleGroupMember,
Remove-SharingPolicy, Remove-Subscription, Remove-SweepRule, Remove-SyncMailPublicFolde r, Remove-SyncRequest,
Remove-TransportRule, Remove-UMAutoAttendant, Remove-UMCallAnsweringRule , Remove-UMDialPlan, Remove-UMHuntGroup,
Remove-UMIPGateway, Remove-UMMailboxPolicy, Remove-UnifiedGroup, Remove-UnifiedGroupLinks, Remove-UserPhoto,
Resume-MailboxRestoreReque st, Resume-MoveRequest, Resume-PublicFolderMailbox MigrationR equest,
Resume-PublicFolderMigrati onRequest, Resume-SyncRequest, Revoke-ElevatedAccessAutho rization, Rotate-DkimSigningConfig,
Search-AdminAuditLog, Search-MailboxAuditLog, Search-MessageTrackingRepo rt, Search-UnifiedAuditLog,
Send-TextMessagingVerifica tionCode, Set-AcceptedDomain, Set-ActiveSyncDeviceAccess Rule, Set-ActiveSyncMailboxPolic y,
Set-ActiveSyncOrganization Settings, Set-AdminAuditLogConfig, Set-AntiPhishPolicy, Set-AntiPhishRule, Set-App,
Set-ApplicationAccessPolic y, Set-AvailabilityConfig, Set-CalendarNotification, Set-CalendarProcessing, Set-CASMailbox,
set-CASMailboxPlan, Set-ClientAccessRule, Set-Clutter, Set-ConnectSubscription, Set-Contact,
Set-DataEncryptionPolicy, Set-DistributionGroup, Set-DkimSigningConfig, Set-DynamicDistributionGro up,
Set-ElevatedAccessRequest, Set-EmailAddressPolicy, Set-FederatedOrganizationI dentifier, Set-FocusedInbox, Set-Group,
Set-GroupMailbox, Set-HostedConnectionFilter Policy, Set-HostedContentFilterPol icy, Set-HostedContentFilterRul e,
Set-HostedOutboundSpamFilt erPolicy, Set-HotmailSubscription, Set-HybridMailflow, Set-ImapSubscription,
Set-InboundConnector, Set-InboxRule, Set-IntraOrganizationConne ctor, Set-IRMConfiguration, Set-JournalRule,
Set-LinkedUser, Set-Mailbox, Set-MailboxAuditBypassAsso ciation, Set-MailboxAutoReplyConfig uration,
Set-MailboxCalendarConfigu ration, Set-MailboxCalendarFolder, Set-MailboxFolderPermissio n,
Set-MailboxJunkEmailConfig uration, Set-MailboxLocation, Set-MailboxMessageConfigur ation, Set-MailboxPlan,
Set-MailboxRegionalConfigu ration, Set-MailboxRestoreRequest, Set-MailboxSearch, Set-MailboxSpellingConfigu ration,
Set-MailContact, Set-MailPublicFolder, Set-MailUser, Set-MalwareFilterPolicy, Set-MalwareFilterRule,
Set-ManagementRoleAssignme nt, Set-ManagementRoleEntry, Set-ManagementScope, Set-MessageClassification,
Set-MigrationBatch, Set-MigrationConfig, Set-MigrationEndpoint, Set-MigrationUser, Set-MobileDeviceMailboxPol icy,
Set-MoveRequest, Set-Notification, Set-OMEConfiguration, Set-OMEMessageRevocation, Set-OnPremisesOrganization ,
Set-Organization, Set-OrganizationConfig, Set-OrganizationRelationsh ip, Set-OutboundConnector,
Set-OutlookProtectionRule, Set-OwaMailboxPolicy, Set-PartnerApplication, Set-PerimeterConfig, Set-PhishFilterPolicy,
Set-Place, Set-PopSubscription, Set-ProtectionServicePolic y, Set-PublicFolder,
Set-PublicFolderMailboxMig rationRequ est, Set-PublicFolderMigrationR equest, Set-RemoteDomain, Set-ReportSchedule,
Set-ResourceConfig, Set-RetentionPolicy, Set-RetentionPolicyTag, Set-RMSTemplate, Set-RMSTrustedPublishingDo main,
Set-RoleAssignmentPolicy, Set-RoleGroup, Set-SharingPolicy, Set-SiteMailbox, Set-SiteMailboxProvisionin gPolicy,
Set-SmimeConfig, Set-SweepRule, Set-SyncRequest, Set-TextMessagingAccount, Set-TransportConfig, Set-TransportRule,
Set-UMAutoAttendant, Set-UMCallAnsweringRule, Set-UMDialPlan, Set-UMIPGateway, Set-UMMailbox,
Set-UMMailboxConfiguration , Set-UMMailboxPIN, Set-UMMailboxPolicy, Set-UnifiedAuditSetting, Set-UnifiedGroup,
Set-User, Set-UserPhoto, Start-AuditAssistant, Start-HistoricalSearch, Start-ManagedFolderAssista nt,
Start-MigrationBatch, Start-MigrationUser, Start-UMPhoneSession, Stop-HistoricalSearch, Stop-MigrationBatch,
Stop-MigrationUser, Stop-UMPhoneSession, Suspend-MailboxRestoreRequ est, Suspend-MoveRequest,
Suspend-PublicFolderMailbo xMigration Request, Suspend-PublicFolderMigrat ionRequest , Suspend-SyncRequest,
Test-ApplicationAccessPoli cy, Test-ClientAccessRule, Test-DataEncryptionPolicy, Test-IRMConfiguration,
Test-MAPIConnectivity, Test-MigrationServerAvaila bility, Test-OAuthConnectivity, Test-OrganizationRelations hip,
Test-SiteMailbox, Troubleshoot-AgendaMail, Undo-SoftDeletedMailbox, Undo-SoftDeletedUnifiedGro up,
Update-DistributionGroupMe mber, Update-HybridConfiguration , Update-PublicFolderMailbox , Update-Recipient,
Update-RoleGroupMember, Update-SiteMailbox, Upgrade-DistributionGroup, Validate-OutboundConnector ,
Validate-RetentionRuleQuer y, Write-AdminAuditLog', because it would shadow an existing local command. Use the
AllowClobber parameter if you want to shadow existing local commands.
Import-PSSession : No command proxies have been created, because all of the requested remote commands would shadow
existing local commands. Use the AllowClobber parameter if you want to shadow existing local commands.
At D:\temp\DL\0365Connect.ps1 :4 char:1
+ Import-PSSession $Session
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Import-PSSession], ArgumentException
+ FullyQualifiedErrorId : ErrorNoCommandsImportedBec auseOfSkip ping,Micro soft.Power Shell.Comm ands.Impor tPSSession C
ommand
WARNING: Proxy creation has been skipped for the following command: 'Add-AvailabilityAddressSp
Add-DistributionGroupMembe
Add-ManagementRoleEntry, Add-PublicFolderClientPerm
Add-UnifiedGroupLinks, Approve-ElevatedAccessRequ
Clear-TextMessagingAccount
ConvertFrom-ExoJobData.ps1
Disable-HostedContentFilte
Disable-MailPublicFolder, Disable-MalwareFilterRule,
Disable-TransportRule, Disable-UMAutoAttendant, Disable-UMCallAnsweringRul
Enable-AntiPhishRule, Enable-App, Enable-HostedContentFilter
Enable-Mailbox, Enable-MailPublicFolder, Enable-MalwareFilterRule, Enable-OrganizationCustomi
Enable-OutlookProtectionRu
Enable-UMCallAnsweringRule
Export-MigrationReport, Export-QuarantineMessage, Export-TransportRuleCollec
Export-UMPrompt, Get-AcceptedDomain, Get-ActiveSyncDevice, Get-ActiveSyncDeviceAccess
Get-ActiveSyncDeviceStatis
Get-AddressBookPolicy, Get-AdminAuditLogConfig, Get-AdministrativeUnit, Get-AdvancedThreatProtecti
Get-AdvancedThreatProtecti
Get-ApplicationAccessPolic
Get-AuditConfigurationRule
Get-BlockedSenderAddress, Get-CalendarDiagnosticAnal
Get-CalendarNotification, Get-CalendarProcessing, Get-CalendarViewDiagnostic
Get-ClientAccessRule, Get-Clutter, Get-CompliancePolicyFileSy
Get-ComplianceTag, Get-ComplianceTagStorage, Get-ConnectionByClientType
Get-ConnectSubscription, Get-Contact, Get-CsActiveUserReport, Get-CsAVConferenceTimeRepo
Get-CsClientDeviceDetailRe
Get-CsP2PSessionReport, Get-CsPSTNConferenceTimeRe
Get-CsUsersBlockedReport, Get-DataEncryptionPolicy, Get-DataRetentionReport, Get-DeviceComplianceDetail
Get-DeviceComplianceDetail
Get-DeviceComplianceSummar
Get-DeviceConditionalAcces
Get-DeviceConfigurationRul
Get-DistributionGroupMembe
Get-DlpSensitiveInformatio
Get-ElevatedAccessApproval
Get-EligibleDistributionGr
Get-FederatedOrganizationI
Get-FocusedInbox, Get-Group, Get-GroupActivityReport, Get-GroupMailbox, Get-HistoricalSearch,
Get-HostedConnectionFilter
Get-HostedOutboundSpamFilt
Get-ImapSubscription, Get-InboundConnector, Get-InboxRule, Get-IntraOrganizationConfi
Get-IntraOrganizationConne
Get-LinkedUser, Get-LogonStatistics, Get-Mailbox, Get-MailboxActivityReport,
Get-MailboxAutoReplyConfig
Get-MailboxFolderPermissio
Get-MailboxMessageConfigur
Get-MailboxPreferredLocati
Get-MailboxRestoreRequestS
Get-MailboxUsageDetailRepo
Get-MailDetailATPReport, Get-MailDetailMalwareRepor
Get-MailDetailTransportRul
Get-MailTrafficPolicyRepor
Get-MailUser, Get-MalwareFilterPolicy, Get-MalwareFilterRule, Get-ManagementRole, Get-ManagementRoleAssignme
Get-ManagementRoleEntry, Get-ManagementScope, Get-MessageCategory, Get-MessageClassification,
Get-MessageTrace, Get-MessageTraceDetail, Get-MessageTrackingReport,
Get-MigrationEndpoint, Get-MigrationStatistics, Get-MigrationUser, Get-MigrationUserStatistic
Get-MobileDeviceDashboardS
Get-MoveRequestStatistics,
Get-O365ClientBrowserDetai
Get-OMEConfiguration, Get-OMEMessageStatus, Get-OnlineMeetingConfigura
Get-OrganizationalUnit, Get-OrganizationConfig, Get-OrganizationRelationsh
Get-OutboundConnectorRepor
Get-PartnerCustomerUserRep
Get-PopSubscription, Get-PublicFolder, Get-PublicFolderClientPerm
Get-PublicFolderMailboxDia
Get-PublicFolderMailboxMig
Get-PublicFolderMigrationR
Get-QuarantineMessageHeade
Get-RecipientStatisticsRep
Get-ReportScheduleList, Get-ResourceConfig, Get-RetentionEvent, Get-RetentionPolicy, Get-RetentionPolicyTag,
Get-RMSTemplate, Get-RMSTrustedPublishingDo
Get-SCInsights, Get-ScorecardClientDeviceR
Get-ScorecardMetricsReport
Get-ServiceDeliveryReport,
Get-SiteMailboxProvisionin
Get-SPOSkyDriveProDeployed
Get-SPOTeamSiteStorageRepo
Get-Subscription, Get-SupervisoryReviewPolic
Get-SupervisoryReviewRule,
Get-TextMessagingAccount, Get-ToolInformation, Get-TransportConfig, Get-TransportRule, Get-TransportRuleAction,
Get-TransportRulePredicate
Get-UMCallSummaryReport, Get-UMDialPlan, Get-UMHuntGroup, Get-UMIPGateway, Get-UMMailbox, Get-UMMailboxConfiguration
Get-UMMailboxPIN, Get-UMMailboxPlan, Get-UMMailboxPolicy, Get-UMPhoneSession, Get-UnifiedAuditSetting,
Get-UnifiedGroup, Get-UnifiedGroupLinks, Get-User, Get-UserPhoto, Import-ContactList, Import-RecipientDataProper
Import-RMSTrustedPublishin
New-ActiveSyncMailboxPolic
New-ApplicationAccessPolic
New-ConnectSubscription, New-DistributionGroup, New-DkimSigningConfig, New-DynamicDistributionGro
New-ElevatedAccessRequest,
New-HostedContentFilterRul
New-IntraOrganizationConne
New-MailboxRestoreRequest,
New-MalwareFilterRule, New-ManagementRole, New-ManagementRoleAssignme
New-MessageClassification,
New-OnPremisesOrganization
New-OwaMailboxPolicy, New-PartnerApplication, New-PopSubscription, New-PrivilegedIdentityMana
New-ProtectionServicePolic
New-RetentionPolicy, New-RetentionPolicyTag, New-RoleAssignmentPolicy, New-RoleGroup, New-SchedulingMailbox,
New-SharingPolicy, New-SiteMailbox, New-SiteMailboxProvisionin
New-SyncMailPublicFolder, New-SyncRequest, New-TransportRule, New-UMAutoAttendant, New-UMCallAnsweringRule,
New-UMDialPlan, New-UMHuntGroup, New-UMIPGateway, New-UMMailboxPolicy, New-UnifiedGroup, Preview-QuarantineMessage,
Release-QuarantineMessage,
Remove-AntiPhishPolicy, Remove-AntiPhishRule, Remove-App, Remove-ApplicationAccessPo
Remove-AuditConfigurationP
Remove-AvailabilityAddress
Remove-ClientAccessRule, Remove-CompliancePolicyFil
Remove-ConnectSubscription
Remove-EmailAddressPolicy,
Remove-HostedContentFilter
Remove-IntraOrganizationCo
Remove-MailboxLocation, Remove-MailboxPermission, Remove-MailboxRestoreReque
Remove-MailboxUserConfigur
Remove-MalwareFilterRule, Remove-ManagementRole, Remove-ManagementRoleAssig
Remove-ManagementScope, Remove-MessageClassificati
Remove-MigrationUser, Remove-MobileDevice, Remove-MobileDeviceMailbox
Remove-OnPremisesOrganizat
Remove-OutlookProtectionRu
Remove-PublicFolderClientP
Remove-RemoteDomain, Remove-ReportSchedule, Remove-RetentionPolicy, Remove-RetentionPolicyTag,
Remove-RMSTrustedPublishin
Remove-SharingPolicy, Remove-Subscription, Remove-SweepRule, Remove-SyncMailPublicFolde
Remove-TransportRule, Remove-UMAutoAttendant, Remove-UMCallAnsweringRule
Remove-UMIPGateway, Remove-UMMailboxPolicy, Remove-UnifiedGroup, Remove-UnifiedGroupLinks, Remove-UserPhoto,
Resume-MailboxRestoreReque
Resume-PublicFolderMigrati
Search-AdminAuditLog, Search-MailboxAuditLog, Search-MessageTrackingRepo
Send-TextMessagingVerifica
Set-ActiveSyncOrganization
Set-ApplicationAccessPolic
set-CASMailboxPlan, Set-ClientAccessRule, Set-Clutter, Set-ConnectSubscription, Set-Contact,
Set-DataEncryptionPolicy, Set-DistributionGroup, Set-DkimSigningConfig, Set-DynamicDistributionGro
Set-ElevatedAccessRequest,
Set-GroupMailbox, Set-HostedConnectionFilter
Set-HostedOutboundSpamFilt
Set-InboundConnector, Set-InboxRule, Set-IntraOrganizationConne
Set-LinkedUser, Set-Mailbox, Set-MailboxAuditBypassAsso
Set-MailboxCalendarConfigu
Set-MailboxJunkEmailConfig
Set-MailboxRegionalConfigu
Set-MailContact, Set-MailPublicFolder, Set-MailUser, Set-MalwareFilterPolicy, Set-MalwareFilterRule,
Set-ManagementRoleAssignme
Set-MigrationBatch, Set-MigrationConfig, Set-MigrationEndpoint, Set-MigrationUser, Set-MobileDeviceMailboxPol
Set-MoveRequest, Set-Notification, Set-OMEConfiguration, Set-OMEMessageRevocation, Set-OnPremisesOrganization
Set-Organization, Set-OrganizationConfig, Set-OrganizationRelationsh
Set-OutlookProtectionRule,
Set-Place, Set-PopSubscription, Set-ProtectionServicePolic
Set-PublicFolderMailboxMig
Set-ResourceConfig, Set-RetentionPolicy, Set-RetentionPolicyTag, Set-RMSTemplate, Set-RMSTrustedPublishingDo
Set-RoleAssignmentPolicy, Set-RoleGroup, Set-SharingPolicy, Set-SiteMailbox, Set-SiteMailboxProvisionin
Set-SmimeConfig, Set-SweepRule, Set-SyncRequest, Set-TextMessagingAccount, Set-TransportConfig, Set-TransportRule,
Set-UMAutoAttendant, Set-UMCallAnsweringRule, Set-UMDialPlan, Set-UMIPGateway, Set-UMMailbox,
Set-UMMailboxConfiguration
Set-User, Set-UserPhoto, Start-AuditAssistant, Start-HistoricalSearch, Start-ManagedFolderAssista
Start-MigrationBatch, Start-MigrationUser, Start-UMPhoneSession, Stop-HistoricalSearch, Stop-MigrationBatch,
Stop-MigrationUser, Stop-UMPhoneSession, Suspend-MailboxRestoreRequ
Suspend-PublicFolderMailbo
Test-ApplicationAccessPoli
Test-MAPIConnectivity, Test-MigrationServerAvaila
Test-SiteMailbox, Troubleshoot-AgendaMail, Undo-SoftDeletedMailbox, Undo-SoftDeletedUnifiedGro
Update-DistributionGroupMe
Update-RoleGroupMember, Update-SiteMailbox, Upgrade-DistributionGroup,
Validate-RetentionRuleQuer
AllowClobber parameter if you want to shadow existing local commands.
Import-PSSession : No command proxies have been created, because all of the requested remote commands would shadow
existing local commands. Use the AllowClobber parameter if you want to shadow existing local commands.
At D:\temp\DL\0365Connect.ps1
+ Import-PSSession $Session
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Import-PSSession], ArgumentException
+ FullyQualifiedErrorId : ErrorNoCommandsImportedBec
ommand
If all of that came up in yellow you may already be connected. Ok do the following
As a test do a Get-Mailbox 'whateveremailAddressyouha veino365 | Select DisplayName,WindowsEmailAd dress
If it gives you results you are already in then go to below instructions
We bulk add all the members to all the dls with the below steps and powershell command
1. Go to the .csv c:\temp\o365grps.csv and a create another header named Path
2. In each Row that has a group name input the path to where the .csv that contains the groupmembers is located
example DistributionGroup1 now has all the groupmembers in the .csv c:\temp\DistributionGroup1 .csv
You will put c:\temp\DistributionGroup1 .csv in the path column for that DistributionGroup. Set the path for all your groupmembers for their Distribution groups.
Now put the below in a notepad, save it to c:\temp as Addo365members.ps1
$csv = import-csv 'c:\temp\o365grps.csv'
foreach ($c in $csv) {
Import-csv $c.path | %{Add-DistributionGroupMem ber $c.name -Member $_.PrimarySmtpAddress}
}
cd to c:temp then type .\Addo365members.ps1 press enter
All your dls will now populate with their members
As a test do a Get-Mailbox 'whateveremailAddressyouha
If it gives you results you are already in then go to below instructions
We bulk add all the members to all the dls with the below steps and powershell command
1. Go to the .csv c:\temp\o365grps.csv and a create another header named Path
2. In each Row that has a group name input the path to where the .csv that contains the groupmembers is located
example DistributionGroup1 now has all the groupmembers in the .csv c:\temp\DistributionGroup1
You will put c:\temp\DistributionGroup1
Now put the below in a notepad, save it to c:\temp as Addo365members.ps1
$csv = import-csv 'c:\temp\o365grps.csv'
foreach ($c in $csv) {
Import-csv $c.path | %{Add-DistributionGroupMem
}
cd to c:temp then type .\Addo365members.ps1 press enter
All your dls will now populate with their members
ASKER
When I run Get-Mailbox 'whateveremailAddressyouha veino365 | Select DisplayName,WindowsEmailAd dress
It comes back with >>
PS D:\temp\DL> Get-Mailbox 'whateveremailAddressyouha veino365 | Select DisplayName,WindowsEmailAd dress
>>
It comes back with >>
PS D:\temp\DL> Get-Mailbox 'whateveremailAddressyouha
>>
I missed a closing quote use any emailaddress you have in o365 inside the quotes below
Get-Mailbox 'whateveremailAddressyouha veino365' | Select DisplayName,WindowsEmailAd dress
Get-Mailbox 'whateveremailAddressyouha
ASKER
I do get a response from Get-Mailbox 'whateveremailAddressyouha veino365 | Select DisplayName,WindowsEmailAd dress
When I run the script I get the error for every DL
The operation couldn't be performed because object 'DLname' couldn't be found on
'DM5PR16A006DC05.NAMPR16A0 06.PROD.OU TLOOK.COM' .
+ CategoryInfo : NotSpecified: (:) [Add-DistributionGroupMemb er], ManagementObjectNotFoundEx ception
+ FullyQualifiedErrorId : [Server=BLUPR16MB0450,Requ estId=d469 672d-4b76- 4ddd-a9fc- d460fdb643 7f,TimeSta mp=10/14/2 0
18 10:21:10 PM] [FailureCategory=Cmdlet-Ma nagementOb jectNotFou ndExceptio n] 693292D4,Microsoft.Exchang e.Manageme nt
.RecipientTasks.AddDistrib utionGroup Member
+ PSComputerName : outlook.office365.com
When I run the script I get the error for every DL
The operation couldn't be performed because object 'DLname' couldn't be found on
'DM5PR16A006DC05.NAMPR16A0
+ CategoryInfo : NotSpecified: (:) [Add-DistributionGroupMemb
+ FullyQualifiedErrorId : [Server=BLUPR16MB0450,Requ
18 10:21:10 PM] [FailureCategory=Cmdlet-Ma
.RecipientTasks.AddDistrib
+ PSComputerName : outlook.office365.com
Did you run the scropt to xreate the dls?
Import-Csv 'c:\temp\o365grps.csv' | %{New-DistributionGroup -Name $_.Name -DisplayName $_.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySMTPAddress -ManagedBy $_.managedby}
Import-Csv 'c:\temp\o365grps.csv' | %{New-DistributionGroup -Name $_.Name -DisplayName $_.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySMTPAddress -ManagedBy $_.managedby}
ASKER
I have all the distribution lists created as csv files. That worked. The only think left is importing them
from your O365grps.csv run the above command to create the dls in O365
ASKER
I get this error for every DL
Couldn't find object
"Microsoft.Exchange.Data.D irectory.A DMultiValu edProperty `1[Microso ft.Exchang e.Data.Dir ectory.ADO bjectId]". Please
make sure that it was spelled correctly or specify a different object.
+ CategoryInfo : NotSpecified: (:) [], ManagementObjectNotFoundEx ception
+ FullyQualifiedErrorId : [Server=BLUPR16MB0450,Requ estId=ab8e 0221-f26e- 4ac3-bc06- 6cfe23c982 34,TimeSta mp=10/15/2 0
18 11:31:39 AM] [FailureCategory=Cmdlet-Ma nagementOb jectNotFou ndExceptio n] 289573BB
+ PSComputerName : outlook.office365.com
Couldn't find object
"Microsoft.Exchange.Data.D
make sure that it was spelled correctly or specify a different object.
+ CategoryInfo : NotSpecified: (:) [], ManagementObjectNotFoundEx
+ FullyQualifiedErrorId : [Server=BLUPR16MB0450,Requ
18 11:31:39 AM] [FailureCategory=Cmdlet-Ma
+ PSComputerName : outlook.office365.com
please paste the entire command you are using
ASKER
Import-Csv 'D:\temp\DL\o365grps.csv' | %{New-DistributionGroup -Name $_.Name -DisplayName $_
.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySMTPAddress -ManagedBy $_.managedby}
.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySMTPAddress -ManagedBy $_.managedby}
Under the column managedby in your .csv are there any entries? if not take it off the command. That may be giving us the error.
Import-Csv 'D:\temp\DL\o365grps.csv' | %{New-DistributionGroup -Name $_.Name -DisplayName $_
.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySMTPAddress}
Import-Csv 'D:\temp\DL\o365grps.csv' | %{New-DistributionGroup -Name $_.Name -DisplayName $_
.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySMTPAddress}
ASKER
That created the distribution lists however there are no members. Any chance that will take a bit of time to update in Office 365?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That did it. Thanks so much for sticking with this. I now have DL in Office 365 with all the users
Good work AJ!!!
How many groups were done?
How many groups were done?
ASKER
I had 38 groups that were uploaded
Nice!!!