Forum Discussion

AZ365's avatar
AZ365
Copper Contributor
Jan 13, 2024

Correct name for user location

Hi,

 

When I use AzureAD PowerShell module, I see my own user location under the attribute "PhysicalDeliveryOfficeName". However, when I use the MS Graph module, it's listed under "OfficeLocation". How do I find the real attribute name for it? I ask because our non-PowerShell developer wants to retrieve its value so I am wondering what attribute name I should provide.

 

Thanks.

  • AZ365 

     

    Hi, Andy.

     

    The "real" attribute name isn't relevant. What matters is which method the developer intends to use.

     

    If they intend to use the old - and now deprecated - Azure AD module, then they will have to use physicalDeliveryOfficeName. If they intend to use Microsoft Graph (as distinct from the older Azure AD Graph, which is also deprecated) endpoint (directly or via the associated Microsoft.Graph.* PowerShell modules) - which they should be doing, then they'll be using officeLocation.

     

    You can read more about the Azure AD Graph deprecation here:

     

     

    Graph - both the old and new - sit on top of Azure Active Directory and therefore act as an abstracted layer. Therefore, the "real" name of the attribute is immaterial since you can't access Azure Active Directory directly. This is why all that matters is how the different Graph iterations along with the PowerShell modules that use them name their representations of the underlying directory service attributes.

     

    The presentation of attribute names hasn't been profoundly consistent across the endpoints or their derived PowerShell modules from the outset (over a decade, thinking back to module like MSOnline), so your developer is just going to have to wrap their head around that. Expecting consistency is a recipe for disappointment, if the past ten or so years is any indication.

     

    As a point of trivia, physicalDeliveryOfficeName is the 25+ year old attribute name from the Active Directory schema, but we've seen plenty of divergence in this Azure era from the original Active Directory schema.

     

    Cheers,

    Lain

  • LainRobertson's avatar
    LainRobertson
    Silver Contributor

    AZ365 

     

    Hi, Andy.

     

    The "real" attribute name isn't relevant. What matters is which method the developer intends to use.

     

    If they intend to use the old - and now deprecated - Azure AD module, then they will have to use physicalDeliveryOfficeName. If they intend to use Microsoft Graph (as distinct from the older Azure AD Graph, which is also deprecated) endpoint (directly or via the associated Microsoft.Graph.* PowerShell modules) - which they should be doing, then they'll be using officeLocation.

     

    You can read more about the Azure AD Graph deprecation here:

     

     

    Graph - both the old and new - sit on top of Azure Active Directory and therefore act as an abstracted layer. Therefore, the "real" name of the attribute is immaterial since you can't access Azure Active Directory directly. This is why all that matters is how the different Graph iterations along with the PowerShell modules that use them name their representations of the underlying directory service attributes.

     

    The presentation of attribute names hasn't been profoundly consistent across the endpoints or their derived PowerShell modules from the outset (over a decade, thinking back to module like MSOnline), so your developer is just going to have to wrap their head around that. Expecting consistency is a recipe for disappointment, if the past ten or so years is any indication.

     

    As a point of trivia, physicalDeliveryOfficeName is the 25+ year old attribute name from the Active Directory schema, but we've seen plenty of divergence in this Azure era from the original Active Directory schema.

     

    Cheers,

    Lain

Resources