{"id":691,"date":"2023-07-04T14:24:06","date_gmt":"2023-07-04T05:24:06","guid":{"rendered":"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=691"},"modified":"2023-07-04T14:24:06","modified_gmt":"2023-07-04T05:24:06","slug":"office365%e5%80%8b%e4%ba%ba%e3%81%ab%e5%89%b2%e5%bd%93%e3%81%a6%e3%82%89%e3%82%8c%e3%81%a6%e3%81%84%e3%82%8b%e3%83%a9%e3%82%a4%e3%82%bb%e3%83%b3%e3%82%b9%e5%8f%96%e5%be%97","status":"publish","type":"post","link":"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=691","title":{"rendered":"Office365\u500b\u4eba\u306b\u5272\u5f53\u3066\u3089\u308c\u3066\u3044\u308b\u30e9\u30a4\u30bb\u30f3\u30b9\u53d6\u5f97"},"content":{"rendered":"\n<p>\u524d\u56de\u306e\u8a18\u4e8b\u3067\u306f\u3001\u30c6\u30ca\u30f3\u30c8\u306b\u5272\u5f53\u3066\u3089\u308c\u3066\u3044\u308b\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u4e00\u89a7\u3092\u53d6\u5f97\u3057\u3066\u307f\u305f\u304c\u3001\u4eca\u56de\u306f\u500b\u4eba\u306b\u5272\u5f53\u3066\u3089\u308c\u3066\u3044\u308b\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u3092\u53d6\u5f97\u3057\u3066\u307f\u308b\u3002<\/p>\n\n\n\n<p>\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u4e0b\u8a18\u306e\u6a29\u9650\u304c\u5fc5\u8981\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>User.Read<\/li>\n\n\n\n<li>User.Read.All<\/li>\n\n\n\n<li>User.ReadWrite.All<\/li>\n\n\n\n<li>Directory.Read.All<\/li>\n\n\n\n<li>Directory.ReadWrite.All<\/li>\n<\/ul>\n\n\n\n<p>\u203b\u3053\u308c\u3082\u4f55\u6545Write\u304c\u5fc5\u8981\u306a\u306e\u3060\u308d\u3046??<\/p>\n\n\n\n<p>\u500b\u4eba\u306b\u5272\u5f53\u3066\u3089\u308c\u3066\u3044\u308b\u30e9\u30a4\u30bb\u30f3\u30b9\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3051\u3070\u3088\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-csharp\" data-file=\"\u30e6\u30fc\u30b6\u30fc\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u53d6\u5f97\" data-lang=\"C#\"><code>\/\/ Graph Client\nvar cli = new GraphServiceClient(cred);\n\n\/\/ \u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u53d6\u5f97\nvar lic = await cli.Me.LicenseDetails.GetAsync();\n\n\/\/ \u6307\u5b9a\u30e6\u30fc\u30b6\u30fc\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u53d6\u5f97(\u6a29\u9650\u304c\u5fc5\u8981)\nvar lic = await cli.Users[UserPrincipalName].LicenseDetails.GetAsync();<\/code><\/pre><\/div>\n\n\n\n<p>List&lt;LicenseDetails?>\u304clic.Value\u306b\u8fd4\u3055\u308c\u308b\u3002LicenseDetails\u306e\u5185\u5bb9\u3060\u304c\u3001\u5fc5\u8981\u306a\u306e\u306fSkuPartNumber\u3060\u308d\u3046\u3002\u3053\u308c\u306f\u3001\u524d\u56de\u306e\u8a18\u4e8b\u3068\u540c\u69d8\u306e\u6587\u5b57\u5217\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u5b9f\u884c\u4f8b<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-csharp\" data-file=\"Sample\" data-lang=\"C#\"><code>\/\/ Graph Client\nvar cli = new GraphServiceClient(cred);\n\/\/ \u6307\u5b9a\u30e6\u30fc\u30b6\u30fc\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u53d6\u5f97(\u6a29\u9650\u304c\u5fc5\u8981)\nvar lic = await cli.Users[UserPrincipalName].LicenseDetails.GetAsync();\nif (lic?.Value == null) {\n\tConsole.WriteLine(&quot;\u53d6\u5f97\u5931\u6557&quot;);\n\treturn;\n}\n\nConsole.WriteLine($&quot;{UserPrincipalName}\u306b\u306f\u4ee5\u4e0b\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u304c\u30a2\u30b5\u30a4\u30f3\u3055\u308c\u3066\u3044\u308b&quot;);\nforeach(var v in lic!.Value!) {\n    Console.Write($&quot;{v.SkuPartNumber},&quot;);\n}\nConsole.WriteLine();\n\/* \u5b9f\u884c\u4f8b\nboo@foo.com\u306b\u306f\u4ee5\u4e0b\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u304c\u30a2\u30b5\u30a4\u30f3\u3055\u308c\u3066\u3044\u308b\nOFFICESUBSCRIPTION,EXCHANGESTANDARD,\n*\/<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306e\u8a18\u4e8b\u3067\u306f\u3001\u30c6\u30ca\u30f3\u30c8\u306b\u5272\u5f53\u3066\u3089\u308c\u3066\u3044\u308b\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u4e00\u89a7\u3092\u53d6\u5f97\u3057\u3066\u307f\u305f\u304c\u3001\u4eca\u56de &hellip; <a href=\"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=691\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,9,16,4],"tags":[],"class_list":["post-691","post","type-post","status-publish","format-standard","hentry","category-net","category-c","category-microsoft-graph","category-4"],"_links":{"self":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=691"}],"version-history":[{"count":2,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/691\/revisions"}],"predecessor-version":[{"id":693,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/691\/revisions\/693"}],"wp:attachment":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}