Wednesday, August 5, 2015

How to get Tenant ID for the O365 tenant?



When we start the Office 365 Management APIs preview program, it requires us to send the Tenant ID for the O365 so it could be enabled. Depends on whether you are O365 adminstrator, developer, site owner, or end user, there are different options for your reference.


1. Use O365 Powershell list below to query tenant information. You could refer other blog to retrieve details for your tenant. This is useful for O365 administrator.

Get-MsolPartnerContract -DomainName <domainname.onmicrosoft.com> | Select-Object -TenantId


2. Use Azure Powershell to list tenant ID. You could refer this blog.

Add-AzureAccount


Get-AzureSubscription -Current



3. Use O365 site to retrieve Tenant ID. This is useful for O365 site owners and end users.

Navigate to your Site Settings then "Site App Permissions" and inside there will be listed an App Identifier that will include you Tenant ID. Here you can see the Tenant ID is listed for each app. Everything after the "@" sign will be your tenant ID.






4. Use web service URL to retrieve Tenant ID. useful for O365 site owners and end users.

You can download the Postman and enter the following URL as GET action.

https://<tenant>.sharepoint.com/sites/<sitename>/_vti_bin/client.svc

Add the following as Header:
Authorization Bearer

You will see the Tenant ID in the response body as shown in the screenshot below.


5. Use Azure AD portal retrieve Tenant ID. This is useful for O365 administrator and O365 developers.

Login to the Azure AD Portal, drill down and click “ACTIVE DIRECTORY” and click the name of the company. Copy the ID from the URL.

https://manage.windowsazure.com/teamtelstra.onmicrosoft.com#Workspaces/ActiveDirectoryExtension/Directory/<Tenant ID>/directoryQuickStart

No comments:

Post a Comment