Skip to main content

Microsoft 365

Microsoft 365 is a comprehensive cloud-based productivity and collaboration platform that integrates email, calendar, file storage, contacts, and communication tools for organizations and individuals. This integration platform provides access to query and analyze data across Microsoft 365 services including Outlook email, calendars, OneDrive file storage, and contact management systems.

CategoryCollaboration
DirectionQuery source
Sign-inClient Secret, Client Certificate, Managed Identity / Azure CLI
Query languagesSQLite
Tables22
Query templates102
Websitemicrosoft.com

Before you start​

Huntbase can sign in to Microsoft 365 with any of these methods: Client Secret, Client Certificate, Managed Identity / Azure CLI. Pick one, create the credential in Microsoft 365, then keep it to hand for the Connect step.

Client Secret​

Azure AD app registration using tenant ID

  1. In the Microsoft Entra admin center, browse to Entra ID › App registrations and select New registration. Enter a name, choose Single tenant only, and select Register.
  2. On the app's Overview page, record the Application (client) ID. You also need your tenant ID.
  3. Select API permissions › Add a permission › Microsoft Graph › Application permissions, add the read permissions listed below, and select Add permissions.
  4. Select Grant admin consent for your tenant and confirm.
  5. Select Certificates & secrets › Client secrets › New client secret, add a description and an expiration, and select Add. Copy the secret Value before you leave the page.

Permissions:

  • Calendars.Read
  • Files.Read.All
  • Group.Read.All
  • Mail.Read
  • MailboxSettings.Read
  • SharePointTenantSettings.Read.All
  • Team.ReadBasic.All
  • TeamMember.Read.All
  • User.Read.All

Client Certificate​

Azure AD app registration authenticating with a client certificate (PEM).

  1. Register the app, add the Microsoft Graph application permissions and grant admin consent, as for the client secret method.
  2. In the app registration, select Certificates & secrets › Certificates › Upload certificate.
  3. Select a .cer, .pem or .crt file and select Add.

Permissions:

  • Calendars.Read
  • Files.Read.All
  • Group.Read.All
  • Mail.Read
  • MailboxSettings.Read
  • SharePointTenantSettings.Read.All
  • Team.ReadBasic.All
  • TeamMember.Read.All
  • User.Read.All
Watch out for
  • Client secrets last at most 24 months, and Microsoft recommends less than 12. Plan to rotate the secret before it expires.
  • Each connection covers a single tenant.

For the vendor's own instructions, see Microsoft Entra app registration documentation.

tip

Use a dedicated, read-only credential for Huntbase where the product allows it. Huntbase only needs to read.

Connect Microsoft 365​

  1. Go to Connections and click New connection, or click New connection on the Microsoft 365 product page.
  2. On Product, pick Microsoft 365 and choose the Owner.
  3. On Details, give the connection a Name and, optionally, a Description.
  4. On Connect, fill in the settings and credentials described below.
  5. On Verify, review the summary and click Create & check.

For everything else on the setup page — saving a draft, I'll do this later, and what each check result means — see Connections.

Settings​

Where your Microsoft 365 lives:

FieldRequiredNotes
User ID or EmailNoThe ID or email of the user whose own mailbox, calendar and drive you want to query, such as [email protected].
Azure EnvironmentNoOne of AZUREPUBLICCLOUD (the default), AZURECHINACLOUD or AZUREUSGOVERNMENTCLOUD. One of AZUREPUBLICCLOUD, AZURECHINACLOUD, AZUREUSGOVERNMENTCLOUD. Defaults to AZUREPUBLICCLOUD.
Tenant IDNoYour Microsoft Entra tenant ID. Required for the client secret and client certificate methods, even though the field is optional.
Client IDNoThe Application (client) ID from the app's Overview page. Required for the client secret and client certificate methods, even though the field is optional.
Enable Managed IdentityNo
MSI EndpointNo

Credentials​

Choose a Method, enter a Credential label (for example Production), then fill in the fields for that method.

Client Secret​

FieldRequiredNotes
Client SecretYesThe secret Value that is shown once, when you create the secret. Secret — not shown again after you save it.

Client Certificate​

FieldRequiredNotes
Certificate PathYesSecret — not shown again after you save it.
Certificate PasswordNoSecret — not shown again after you save it.

Managed Identity / Azure CLI​

No fields — choose this method to connect without credentials.

Query it​

Once connected, Microsoft 365 can serve these languages in a query tab, and Scout can use it when you ask in Auto:

LanguageUse it for
SQLiteSQL over the 22 tables listed below, alongside every other connected source.

Example: SQLite​

List basic contact info — Explore the basic contact information for individuals within your Microsoft 365 network.

select
display_name,
mobile_phone,
email_addresses
from
microsoft365_my_contact;

Microsoft 365 ships with 102 query templates. Find them in Library › Queries — see Query templates.

What syncs automatically​

Microsoft 365 comes with a content pack. These queries run on a schedule on each new connection so the entities they find appear in the Activity Feed without you asking. You can turn syncing off from the connection's Synchronisation Settings card.

QueryFinds
Sync usersuser, ldap person
Sync groupsgroup
Sync user license assignmentsuser, product
Sync SharePoint site permissionsgroup, user
Sync verified domainsdomain, organization

Tables​

Microsoft 365 adds 22 tables. Browse their columns from Schema in the query bar's ⋯ menu.

All 22 tables
TableContains
microsoft365_calendarMetadata of the specified user's calendar.
microsoft365_calendar_eventEvents scheduled on the specified calendar.
microsoft365_calendar_groupList all the calendar groups of specified user.
microsoft365_contactContacts owned by the specified user.
microsoft365_driveDrives defined user's shared drives in the Google Drive.
microsoft365_drive_fileRetrieves file's metadata or content owned by an user.
microsoft365_groupGroups in Microsoft 365.
microsoft365_listSharePoint lists in Microsoft 365.
microsoft365_mail_messageRetrieves messages in the specified user's mailbox.
microsoft365_my_calendarMetadata of the specified user's calendar.
microsoft365_my_calendar_eventEvents scheduled on the specified calendar.
microsoft365_my_calendar_groupList all the calendar groups of specified user.
microsoft365_my_contactContacts owned by the specified user.
microsoft365_my_driveDrives defined user's shared drives in the Google Drive.
microsoft365_my_drive_fileRetrieves file's metadata or content owned by an user.
microsoft365_my_mail_messageRetrieves messages in the specified user's mailbox.
microsoft365_organizationMicrosoft 365 organization information including SharePoint, authentication, security defaults, and security settings.
microsoft365_organization_contactRetrieve the list of organizational contacts for this organization.
microsoft365_siteSharePoint sites in Microsoft 365.
microsoft365_teamRetrieves all teams in Microsoft Teams for an organization.
microsoft365_team_memberList the members associated with teams.
microsoft365_userUsers in Microsoft 365.

Next steps​