Forum Discussion
jcasqueiro
Oct 13, 2023Brass Contributor
Exporting users to a csv file with all attributes (normal and extended)
Hi, In O365 I can export all tenant users to a csv file through the admin console but the extended attributes don't show up. Is there script that allows me to create a csv file with all the users...
- Oct 14, 2023Extension attributes can only be fetched via the Graph cmdlets, and you need to specifically request them. So something like this:
Get-MgBetaUser -UserId blabla -Property Id,UserPrincipalName, extension_fe2174665583431c953114ff7268b7b3_Education_ObjectType,
extension_fe2174665583431c953114ff7268b7b3_Education_AnchorId, ... | select Id,UserPrincipalName, extension_fe2174665583431c953114ff7268b7b3_Education_ObjectType,
extension_fe2174665583431c953114ff7268b7b3_Education_AnchorId, ...
VasilMichev
Oct 13, 2023MVP
Which attributes are you referring to, the set of 15 customAttributeXX? The Graph SDK for PowerShell can be used to export most attributes, including the customAttributeXX ones (they are exposed as part of the OnPremisesExtensionAttributes property). For example:
Get-MgBetaUser -UserId email address removed for privacy reasons | select -ExpandProperty OnPremisesExtensionAttributes | fl
Get-MgBetaUser -UserId email address removed for privacy reasons | select -ExpandProperty OnPremisesExtensionAttributes | fl
jcasqueiro
Oct 13, 2023Brass Contributor
Hi Vasil,
I am talking about the ones created by SchoolDataSync in a O365EDU tenant. As far as I can tell, apart from the normal user attributes, the extended ones are:
extension_fe2174665583431c953114ff7268b7b3_Education_ObjectType
extension_fe2174665583431c953114ff7268b7b3_Education_AnchorId
extension_fe2174665583431c953114ff7268b7b3_Education_SyncSource
extension_fe2174665583431c953114ff7268b7b3_Education_SyncSource_TeacherId
extension_fe2174665583431c953114ff7268b7b3_Education_TeacherNumber
extension_fe2174665583431c953114ff7268b7b3_Education_TeacherStatus
extension_fe2174665583431c953114ff7268b7b3_Education_Title
extension_fe2174665583431c953114ff7268b7b3_Education_SyncSource_SchoolId
extension_fe2174665583431c953114ff7268b7b3_Education_Email
Thanks
I am talking about the ones created by SchoolDataSync in a O365EDU tenant. As far as I can tell, apart from the normal user attributes, the extended ones are:
extension_fe2174665583431c953114ff7268b7b3_Education_ObjectType
extension_fe2174665583431c953114ff7268b7b3_Education_AnchorId
extension_fe2174665583431c953114ff7268b7b3_Education_SyncSource
extension_fe2174665583431c953114ff7268b7b3_Education_SyncSource_TeacherId
extension_fe2174665583431c953114ff7268b7b3_Education_TeacherNumber
extension_fe2174665583431c953114ff7268b7b3_Education_TeacherStatus
extension_fe2174665583431c953114ff7268b7b3_Education_Title
extension_fe2174665583431c953114ff7268b7b3_Education_SyncSource_SchoolId
extension_fe2174665583431c953114ff7268b7b3_Education_Email
Thanks
- VasilMichevOct 14, 2023MVPExtension attributes can only be fetched via the Graph cmdlets, and you need to specifically request them. So something like this:
Get-MgBetaUser -UserId blabla -Property Id,UserPrincipalName, extension_fe2174665583431c953114ff7268b7b3_Education_ObjectType,
extension_fe2174665583431c953114ff7268b7b3_Education_AnchorId, ... | select Id,UserPrincipalName, extension_fe2174665583431c953114ff7268b7b3_Education_ObjectType,
extension_fe2174665583431c953114ff7268b7b3_Education_AnchorId, ...