Microsoft Graph PowerShell: unable to retrieve or remove properties from profile card

Matías Mödinger Mahú 0 Reputation points
2025-01-10T13:45:55.1833333+00:00

Hello to all of the community,

I was requested to hide an attribute from the profile card for an organization (specifically the "Fax" attribute). So I tried using the Microsoft Graph PowerShell SDK to first list all of the attributes, using the cmdlet Get-MgAdminPeopleProfileCardProperty so that I can get the directoryPropertyName to then remove it by using the cmdlet Remove-MgAdminPeopleProfileCardProperty. Ref: https://learn.microsoft.com/en-us/graph/add-properties-profilecard

The problem is that Get-MgAdminPeopleProfileCardProperty returns nothing:

User's image

And if i try to remove the property, it fails with an error saying that the property doesn't exist:

User's image

I tried using the REST API, also with the same results.

Just so it's clear. the property "Fax" does show up when looking at the profile card of a user (in fact there are more properties, that should be returned by the cmdlet Get-MgAdminPeopleProfileCardProperty). The attribute shows up in both desktop clients and cloud apps.

Any help as to why this is happening (and how to resolve it) is appreciated.

Thanks.

Edit 1: I tried using both "PeopleSettings.Read.All" and "PeopleSettings.ReadWrite.All" as suggested by Robert in the comments, but the results are the same:

User's image

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
5,446 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,744 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Robert Spilman 0 Reputation points Microsoft Employee
    2025-01-10T15:03:42.22+00:00

    "Hi there! It looks like the permissions in the Scope need a little adjustment. Currently, you have 'PeopleSettings.Read.All', but you'll need both 'PeopleSettings.ReadWrite.All' and 'PeopleSettings.Read.All'. Could you please update the Scope permissions and give it another try? Thanks!"


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.