{"id":2313,"date":"2013-12-31T11:59:00","date_gmt":"2013-12-31T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2013\/12\/31\/get-windows-azure-active-directory-tenant-id-in-windows-powershell\/"},"modified":"2013-12-31T11:59:00","modified_gmt":"2013-12-31T11:59:00","slug":"get-windows-azure-active-directory-tenant-id-in-windows-powershell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/get-windows-azure-active-directory-tenant-id-in-windows-powershell\/","title":{"rendered":"Get Windows Azure Active Directory Tenant ID in Windows PowerShell"},"content":{"rendered":"<p><strong>Summary<\/strong>: Get your Windows Azure Active Directory tenant ID in Windows PowerShell.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\">&nbsp;How can I get my Windows Azure Active Directory&nbsp;tenant ID in Windows PowerShell?<\/p>\n<p style=\"margin-left:30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\">&nbsp;Use the <b>Add-AzureAccount <\/b>cmdlet to add your Windows Azure account to Windows PowerShell:<\/p>\n<p style=\"margin-left:120px\">PS C:&gt; Add-AzureAccount<\/p>\n<p style=\"margin-left:30px\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Then use <strong>Get-AzureAccount<\/strong> to get the tenant ID:<\/p>\n<p style=\"margin-left:120px\">PS C:&gt;(Get-AzureAccount).ActiveDirectories.ActiveDirectoryTenantID<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Get your Windows Azure Active Directory tenant ID in Windows PowerShell. &nbsp;How can I get my Windows Azure Active Directory&nbsp;tenant ID in Windows PowerShell? &nbsp;Use the Add-AzureAccount cmdlet to add your Windows Azure account to Windows PowerShell: PS C:&gt; Add-AzureAccount &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Then use Get-AzureAccount to get the tenant ID: PS [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[476,56,370,356,3,45],"class_list":["post-2313","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-azure","tag-guest-blogger","tag-june-blender","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Get your Windows Azure Active Directory tenant ID in Windows PowerShell. &nbsp;How can I get my Windows Azure Active Directory&nbsp;tenant ID in Windows PowerShell? &nbsp;Use the Add-AzureAccount cmdlet to add your Windows Azure account to Windows PowerShell: PS C:&gt; Add-AzureAccount &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Then use Get-AzureAccount to get the tenant ID: PS [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/2313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=2313"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/2313\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=2313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=2313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=2313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}