列出Microsoft Graph API中的用户属性

时间:2019-02-03 16:01:40

标签: azure-active-directory microsoft-graph

我们正在为多家公司集成到Azure AD。作为这项工作的一部分,我们必须询问其系统中的哪些字段需要映射到我们的系统中。

由于人们实际上并没有每天使用系统名称,因此我们遇到的大多数人对此一无所知。

给出正确的凭据,是否有可能获取User对象可以返回的所有属性,或者是否已有预定义的列表?

我能找到的最接近的是this one,但是URL上写着“以前的版本”,所以我不确定是否已更改。

我尝试使用$select=*通过API查找它,但您可能知道这将仅提供默认属性列表。

1 个答案:

答案 0 :(得分:2)

可用属性记录在Graph文档的user resource部分中。 ItemsControl的JSON原型如下:

DataTemplate

为了返回一组特定的属性,您需要在user语句中列出每个属性。您不能使用通配符({ "aboutMe": "string", "accountEnabled": true, "ageGroup": "string", "assignedLicenses": [{"@odata.type": "microsoft.graph.assignedLicense"}], "assignedPlans": [{"@odata.type": "microsoft.graph.assignedPlan"}], "birthday": "String (timestamp)", "businessPhones": ["string"], "city": "string", "companyName": "string", "consentProvidedForMinor": "string", "country": "string", "department": "string", "displayName": "string", "employeeId": "string", "faxNumber" : "string", "givenName": "string", "hireDate": "String (timestamp)", "id": "string (identifier)", "imAddresses": ["string"], "interests": ["string"], "jobTitle": "string", "legalAgeGroupClassification": "string", "licenseAssignmentStates": [{"@odata.type": "microsoft.graph.licenseAssignmentState"}], "mail": "string", "mailboxSettings": {"@odata.type": "microsoft.graph.mailboxSettings"}, "mailNickname": "string", "mobilePhone": "string", "mySite": "string", "officeLocation": "string", "onPremisesDistinguishedName": "string", "onPremisesDomainName": "string", "onPremisesExtensionAttributes": {"@odata.type": "microsoft.graph.onPremisesExtensionAttributes"}, "onPremisesImmutableId": "string", "onPremisesLastSyncDateTime": "String (timestamp)", "onPremisesProvisioningErrors": [{"@odata.type": "microsoft.graph.onPremisesProvisioningError"}], "onPremisesSamAccountName": "string", "onPremisesSecurityIdentifier": "string", "onPremisesSyncEnabled": true, "onPremisesUserPrincipalName": "string", "otherMails": "string", "passwordPolicies": "string", "passwordProfile": {"@odata.type": "microsoft.graph.passwordProfile"}, "pastProjects": ["string"], "postalCode": "string", "preferredDataLocation": "string", "preferredLanguage": "string", "preferredName": "string", "provisionedPlans": [{"@odata.type": "microsoft.graph.provisionedPlan"}], "proxyAddresses": ["string"], "responsibilities": ["string"], "schools": ["string"], "showInAddressList": true, "skills": ["string"], "state": "string", "streetAddress": "string", "surname": "string", "usageLocation": "string", "userPrincipalName": "string", "userType": "string", "calendar": { "@odata.type": "microsoft.graph.calendar" }, "calendarGroups": [{ "@odata.type": "microsoft.graph.calendarGroup" }], "calendarView": [{ "@odata.type": "microsoft.graph.event" }], "calendars": [ {"@odata.type": "microsoft.graph.calendar"} ], "contacts": [ { "@odata.type": "microsoft.graph.contact" } ], "contactFolders": [ { "@odata.type": "microsoft.graph.contactFolder" } ], "createdObjects": [ { "@odata.type": "microsoft.graph.directoryObject" } ], "directReports": [ { "@odata.type": "microsoft.graph.directoryObject" } ], "drive": { "@odata.type": "microsoft.graph.drive" }, "drives": [ { "@odata.type": "microsoft.graph.drive" } ], "events": [ { "@odata.type": "microsoft.graph.event" } ], "inferenceClassification": { "@odata.type": "microsoft.graph.inferenceClassification" }, "mailFolders": [ { "@odata.type": "microsoft.graph.mailFolder" } ], "manager": { "@odata.type": "microsoft.graph.directoryObject" }, "memberOf": [ { "@odata.type": "microsoft.graph.directoryObject" } ], "messages": [ { "@odata.type": "microsoft.graph.message" } ], "outlook": { "@odata.type": "microsoft.graph.outlookUser" }, "ownedDevices": [ { "@odata.type": "microsoft.graph.directoryObject" } ], "ownedObjects": [ { "@odata.type": "microsoft.graph.directoryObject" } ], "photo": { "@odata.type": "microsoft.graph.profilePhoto" }, "registeredDevices": [ { "@odata.type": "microsoft.graph.directoryObject" } ] } )来检索整个集合。最简单的方法是从默认的$select开始,然后添加您要查找的附加属性:

*