Table of Contents

Interface IMicrosoft365Admin

Namespace
PnP.Core.Admin.Model.Microsoft365
Assembly
PnP.Core.Admin.dll

Microsoft 365 Admin features

public interface IMicrosoft365Admin

Methods

AccessTokenHasRole(string)

Checks if the current access token holds the requested role

bool AccessTokenHasRole(string role)

Parameters

role string

Role to check for

Returns

bool

True if the token has the role, false otherwise

AccessTokenHasRole(string, string)

Checks if the provided access token holds the requested role

bool AccessTokenHasRole(string accessToken, string role)

Parameters

accessToken string

Accesstoken to inspect

role string

Role to check for

Returns

bool

True if the token has the role, false otherwise

AccessTokenHasRoleAsync(string)

Checks if the current access token holds the requested role

Task<bool> AccessTokenHasRoleAsync(string role)

Parameters

role string

Role to check for

Returns

Task<bool>

True if the token has the role, false otherwise

AccessTokenHasScope(string)

Checks if the current access token holds the requested scope

bool AccessTokenHasScope(string scope)

Parameters

scope string

Scope to check for

Returns

bool

True if the token has the scope, false otherwise

AccessTokenHasScope(string, string)

Checks if the provided access token holds the requested scope

bool AccessTokenHasScope(string accessToken, string scope)

Parameters

accessToken string

Accesstoken to inspect

scope string

Scope to check for

Returns

bool

True if the token has the scope, false otherwise

AccessTokenHasScopeAsync(string)

Checks if the current access token holds the requested scope

Task<bool> AccessTokenHasScopeAsync(string scope)

Parameters

scope string

Scopee to check for

Returns

Task<bool>

True if the token has the scope, false otherwise

AccessTokenUsesApplicationPermissions()

Checks if the current access token uses application permissions

bool AccessTokenUsesApplicationPermissions()

Returns

bool

True if using application permissions, false otherwise

AccessTokenUsesApplicationPermissions(string)

Checks if the provided access token uses application permissions

bool AccessTokenUsesApplicationPermissions(string accessToken)

Parameters

accessToken string

Accesstoken to inspect

Returns

bool

True if using application permissions, false otherwise

AccessTokenUsesApplicationPermissionsAsync()

Checks if the current access token uses application permissions

Task<bool> AccessTokenUsesApplicationPermissionsAsync()

Returns

Task<bool>

True if using application permissions, false otherwise

CreateGroup(GraphGroupOptions, CreationOptions)

Create a Microsoft 365 Group

PnPContext CreateGroup(GraphGroupOptions graphGroupOptions, CreationOptions creationOptions = null)

Parameters

graphGroupOptions GraphGroupOptions

Options that define the Microsoft 365 Group to create

creationOptions CreationOptions

Options that control the group creation process

Returns

PnPContext

PnPContext for the SharePoint site linked the new group

CreateGroupAsync(GraphGroupOptions, CreationOptions)

Create a Microsoft 365 Group

Task<PnPContext> CreateGroupAsync(GraphGroupOptions graphGroupOptions, CreationOptions creationOptions = null)

Parameters

graphGroupOptions GraphGroupOptions

Options that define the Microsoft 365 Group to create

creationOptions CreationOptions

Options that control the group creation process

Returns

Task<PnPContext>

PnPContext for the SharePoint site linked the new group

GetMultiGeoLocations()

Returns a list of multi-geo locations for this tenant

List<IGeoLocationInformation> GetMultiGeoLocations()

Returns

List<IGeoLocationInformation>

List of multi-geo locations if multi-geo, null otherwise

GetMultiGeoLocationsAsync()

Returns a list of multi-geo locations for this tenant

Task<List<IGeoLocationInformation>> GetMultiGeoLocationsAsync()

Returns

Task<List<IGeoLocationInformation>>

List of multi-geo locations if multi-geo, null otherwise

GetSensitivityLabels()

Get the available sensitivity labels for the calling user or application

List<ISensitivityLabel> GetSensitivityLabels()

Returns

List<ISensitivityLabel>

List of sensitivity labels

GetSensitivityLabelsAsync()

Get the available sensitivity labels for the calling user or application

Task<List<ISensitivityLabel>> GetSensitivityLabelsAsync()

Returns

Task<List<ISensitivityLabel>>

List of sensitivity labels

GroupExists(string)

Check if a Microsoft 365 group exists

bool GroupExists(string mailNickName)

Parameters

mailNickName string

Microsoft 365 group alias to check for

Returns

bool

True if the group exists, false otherwise

GroupExistsAsync(string)

Check if a Microsoft 365 group exists

Task<bool> GroupExistsAsync(string mailNickName)

Parameters

mailNickName string

Microsoft 365 group alias to check for

Returns

Task<bool>

True if the group exists, false otherwise

IsMultiGeoTenant()

Checks if this tenant is a multi-geo tenant

bool IsMultiGeoTenant()

Returns

bool

True if multi-geo, false otherwise

IsMultiGeoTenantAsync()

Checks if this tenant is a multi-geo tenant

Task<bool> IsMultiGeoTenantAsync()

Returns

Task<bool>

True if multi-geo, false otherwise