Commit 81cb07b4 authored by Jos Lieben's avatar Jos Lieben

commit of script to get O365 / azure tenant ID from login name of a user

parent 276e552c
function get-tenantIdFromLogin(){
Retrieves an Office 365 / Azure AD tenant ID for a given user login name (email address)
$tenantId = get-tenantIdFromLogin -Username
the UPN of a user
filename: get-tenantIdFromLogin.ps1
author: Jos Lieben
created: 8/3/2019
$openIdInfo = Invoke-RestMethod "$($Username.Split("@")[1])/.well-known/openid-configuration" -Method GET
return $openIdInfo.userinfo_endpoint.Split("/")[3]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment