Retrieve Azure Tenant Id using PowerShell

CodeSnippets #1

I have an idea to do a series of short blog posts over the year with helpful PowerShell functions, SQL code or problems I’ve encountered. The kind of thing I wouldn’t bother writing about as it would barely hit 200 words. I’d love some feedback on whether these “snippets” are helpful.


This is a very handy little function that I refer to on a regular basis when working with Azure and Power BI in PowerShell. The purpose of the function is to quickly retrieve the tenant Id of any Azure tenant based on the provided parameter. The user can provide a domain name or a valid email address. The function queries Azure anonymously so there’s no requirement to login first.

You can also find this up on my Github. PRs are always welcome!

Enjoy!

 

You may also like...

1 Response

  1. Oh nice I like it Craig! 🙂

Leave a Reply