How can i export the members list of a exchange online dynamic distribution group to inc the attribute employeenumber? EmployeeNumber is an onprem attribute but we have synced this to Azure AD using Directory Sync i would like a export of all users in the exchange online dynamic distribution group "allcompanyusers" i would like it to include the username, email address and the employeenumber i believe employeenumber is different in azure ad?
i have ran the following command however the employeenumber is empty the display name and email address is populated
Get-Recipient -RecipientPreviewFilter (get-dynamicdistributiongroup Allcompanyusers).RecipientFilter -OrganizationalUnit $group.RecipientContainer | Select Displayname,alias,PrimarySmtpAddress,employeenumber | Export-Csv "c:\scripts\allcompanyusers.csv" -Notypeinformation