0

是否可以通过 API 获取我拥有的 Azure AD 目录列表?我能够访问 Azure AD Graph API 以获取每个特定目录的用户/组信息,但是,我想列出与我的 Azure 订阅关联的所有目录。

如有必要,我什至可以单独查询每个目录。我只想尽可能地列出目录。但是,查看用户、组和目录角色的输出,我还没有看到任何实际显示目录对象的显示名称的属性。

谢谢。

4

1 回答 1

1

我还没有发现可以列出所有 AD 租户的端点,但是您可以通过端点获取租户的TenantDetails/tenantDetails

示例输出(使用我正在开发的尚未发布的 Ruby gem):

#
# ids and names obfuscated...
#
[2] pry(main)> client.get('/tenantDetails').docs
=> [{"odata.type"=>"Microsoft.DirectoryServices.TenantDetail",
  "objectType"=>"Company",
  "objectId"=>"38041ede-...",
  "deletionTimestamp"=>nil,
  "assignedPlans"=>
   [{"assignedTimestamp"=>"2015-10-27T18:55:12Z", "capabilityStatus"=>"Enabled", "service"=>"AccessControlServiceKey", "servicePlanId"=>"e4f8ab60-..."},
    {"assignedTimestamp"=>"2015-10-23T15:13:34Z", "capabilityStatus"=>"Enabled", "service"=>"AccessControlServiceS2S", "servicePlanId"=>"11d043ce-..."},
    {"assignedTimestamp"=>"2015-10-23T15:13:34Z", "capabilityStatus"=>"Enabled", "service"=>"AccessControlServiceS2S", "servicePlanId"=>"11d043ce-..."},
    {"assignedTimestamp"=>"2015-10-23T15:13:34Z", "capabilityStatus"=>"Enabled", "service"=>"AccessControlServiceS2S", "servicePlanId"=>"11d043ce-..."}],
  "city"=>nil,
  "companyLastDirSyncTime"=>nil,
  "country"=>nil,
  "countryLetterCode"=>"US",
  "dirSyncEnabled"=>nil,
  "displayName"=>"AD Testing...",
  "marketingNotificationEmails"=>["marketing@..."],
  "postalCode"=>nil,
  "preferredLanguage"=>"en",
  "provisionedPlans"=>
   [{"capabilityStatus"=>"Enabled", "provisioningStatus"=>"Success", "service"=>"AccessControlServiceS2S"}, {"capabilityStatus"=>"Enabled", "provisioningStatus"=>"Success", "service"=>"AccessControlServiceS2S"}],
  "provisioningErrors"=>[],
  "securityComplianceNotificationMails"=>[],
  "securityComplianceNotificationPhones"=>[],
  "state"=>nil,
  "street"=>nil,
  "technicalNotificationMails"=>["craig@..."],
  "telephoneNumber"=>nil,
  "verifiedDomains"=>[{"capabilities"=>"Email, OfficeCommunicationsOnline", "default"=>true, "id"=>"00057...", "initial"=>true, "name"=>"....onmicrosoft.com", "type"=>"Managed"}]}]
于 2015-11-16T13:19:55.687 回答