Azure AD Graph API:列出目录对象



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

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

谢谢。

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

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

#
# 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"}]}]

相关内容

  • 没有找到相关文章

最新更新