Skip to content

Instantly share code, notes, and snippets.

@matt40k
Last active February 18, 2019 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matt40k/6f20980cfb9c77bd21cff5ce145a8d72 to your computer and use it in GitHub Desktop.
Save matt40k/6f20980cfb9c77bd21cff5ce145a8d72 to your computer and use it in GitHub Desktop.
Get a Office365 Tenant ID
$domain = "microsoft.com"
$tenantId = (Invoke-WebRequest -UseBasicParsing https://login.windows.net/$domain/.well-known/openid-configuration|ConvertFrom-Json).token_endpoint.Split('/')[3]
Write-Host $tenantId
#Get-Module AzureADPreview
#Install-Module AzureADPreview
#Connect-AzureAD
$o = Get-AzureADUser -ObjectID matt@pbiuser.com
Get-AzureADUser -ObjectID matt@pbiuser.com | select -Expand StrongAuthenticationUserDetails
Write-Host $o
Write-Host $o.OtherMails[0]
Write-Host $o.ProxyAddresses[0]
Get-AzureADUser | select DisplayName,UserPrincipalName,otherMails,Mobile,TelephoneNumber | Format-Table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment