Class UnifiedGroupsUtility
Class that deals with Unified group CRUD operations.
Inheritance
Namespace: PnP.Framework.Graph
Assembly: PnP.Framework.dll
Syntax
public static class UnifiedGroupsUtility : object
Methods
AddUnifiedGroupMembers(String, String[], String, Boolean, Int32, Int32, AzureEnvironment)
Adds members to a Microsoft 365 group
Declaration
public static void AddUnifiedGroupMembers(string groupId, string[] members, string accessToken, bool removeExistingMembers = false, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
Id of the Microsoft 365 group to add the members to |
|
System.String[]
members
String array with the UPNs of the users that need to be added as members to the group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Boolean
removeExistingMembers
If true, all existing members will be removed and only those provided will become members. If false, existing members will remain and the ones provided will be added to the list with existing members. |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
AddUnifiedGroupOwners(String, String[], String, Boolean, Int32, Int32, AzureEnvironment)
Adds owners to a Microsoft 365 group
Declaration
public static void AddUnifiedGroupOwners(string groupId, string[] owners, string accessToken, bool removeExistingOwners = false, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
Id of the Microsoft 365 group to add the owners to |
|
System.String[]
owners
String array with the UPNs of the users that need to be added as owners to the group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Boolean
removeExistingOwners
If true, all existing owners will be removed and only those provided will become owners. If false, existing owners will remain and the ones provided will be added to the list with existing owners. |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
ClearUnifiedGroupMembers(String, String, Int32, Int32, AzureEnvironment)
Removes all members of a Microsoft 365 group
Declaration
public static void ClearUnifiedGroupMembers(string groupId, string accessToken, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
Id of the Microsoft 365 group to remove all the current members of |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
ClearUnifiedGroupOwners(String, String, Int32, Int32, AzureEnvironment)
Removes all owners of a Microsoft 365 group
Declaration
public static void ClearUnifiedGroupOwners(string groupId, string accessToken, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
Id of the Microsoft 365 group to remove all the current owners of |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
CreateTeam(String, String, Int32, AzureEnvironment)
Creates a team associated with an Office 365 group
Declaration
public static async Task CreateTeam(string groupId, string accessToken, int timeoutSeconds = 300, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
The ID of the Office 365 Group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
timeoutSeconds
Time to wait till Team is created. Default is 300 seconds (5 mins) |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
Task
|
CreateUnifiedGroup(String, String, String, String, String[], String[], Stream, Boolean, Boolean, Int32, Int32, AzureEnvironment, Nullable<Office365Geography>, Guid[], Boolean, String, UInt32, Guid, Guid)
Creates a new Office 365 Group (i.e. Unified Group) with its backing Modern SharePoint Site
Declaration
public static UnifiedGroupEntity CreateUnifiedGroup(string displayName, string description, string mailNickname, string accessToken, string[] owners = null, string[] members = null, Stream groupLogo = null, bool isPrivate = false, bool createTeam = false, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment), Office365Geography? preferredDataLocation = null, Guid[] assignedLabels = null, bool welcomeEmailDisabled = false, string siteAlias = "", uint lcid = null, Guid hubSiteId = null, Guid siteDesignId = null)
Parameters
|
System.String
displayName
The Display Name for the Office 365 Group |
|
System.String
description
The Description for the Office 365 Group |
|
System.String
mailNickname
The Mail Nickname for the Office 365 Group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.String[]
owners
A list of UPNs for group owners, if any |
|
System.String[]
members
A list of UPNs for group members, if any |
|
Stream
groupLogo
The binary stream of the logo for the Office 365 Group |
|
System.Boolean
isPrivate
Defines whether the group will be private or public, optional with default false (i.e. public) |
|
System.Boolean
createTeam
Defines whether to create MS Teams team associated with the group |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
|
System.Nullable<Office365Geography>
preferredDataLocation
Defines the codes of geographies in which there is Office 365 presence. Used for multi-geo enabled tenants. List with available geographies is available at https://docs.microsoft.com/office365/enterprise/multi-geo-add-group-with-pdl#geo-location-codes. |
|
Guid[]
assignedLabels
AIP Labels which should be applied to the group (does not work for App-Only) |
|
System.Boolean
welcomeEmailDisabled
Option to prevent sending of default welcome emails to new members. |
|
System.String
siteAlias
The SharePoint site URL alias, if not specified mailNickName will be used |
|
System.UInt32
lcid
The LCID or default language of the SharePoint site |
|
Guid
hubSiteId
The HubSiteId of the SharePoint site |
|
Guid
siteDesignId
The SiteDesignId to be applied to SharePoint site |
Returns
|
UnifiedGroupEntity
The just created Office 365 Group |
CreateUnifiedGroup(String, String, String, String, String[], String[], Boolean, Boolean, Int32, Int32, AzureEnvironment, Nullable<Office365Geography>)
Creates a new Office 365 Group (i.e. Unified Group) with its backing Modern SharePoint Site
Declaration
public static UnifiedGroupEntity CreateUnifiedGroup(string displayName, string description, string mailNickname, string accessToken, string[] owners = null, string[] members = null, bool isPrivate = false, bool createTeam = false, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment), Office365Geography? preferredDataLocation = null)
Parameters
|
System.String
displayName
The Display Name for the Office 365 Group |
|
System.String
description
The Description for the Office 365 Group |
|
System.String
mailNickname
The Mail Nickname for the Office 365 Group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.String[]
owners
A list of UPNs for group owners, if any |
|
System.String[]
members
A list of UPNs for group members, if any |
|
System.Boolean
isPrivate
Defines whether the group will be private or public, optional with default false (i.e. public) |
|
System.Boolean
createTeam
Defines whether to create MS Teams team associated with the group |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
|
System.Nullable<Office365Geography>
preferredDataLocation
Defines the codes of geographies in which there is Office 365 presence. Used for multi-geo enabled tenants. List with available geographies is available at https://docs.microsoft.com/office365/enterprise/multi-geo-add-group-with-pdl#geo-location-codes. |
Returns
|
UnifiedGroupEntity
The just created Office 365 Group |
CreateUnifiedGroup(String, String, String, String, String[], String[], String, Boolean, Boolean, Int32, Int32, AzureEnvironment, Nullable<Office365Geography>)
Creates a new Office 365 Group (i.e. Unified Group) with its backing Modern SharePoint Site
Declaration
public static UnifiedGroupEntity CreateUnifiedGroup(string displayName, string description, string mailNickname, string accessToken, string[] owners = null, string[] members = null, string groupLogoPath = null, bool isPrivate = false, bool createTeam = false, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment), Office365Geography? preferredDataLocation = null)
Parameters
|
System.String
displayName
The Display Name for the Office 365 Group |
|
System.String
description
The Description for the Office 365 Group |
|
System.String
mailNickname
The Mail Nickname for the Office 365 Group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.String[]
owners
A list of UPNs for group owners, if any |
|
System.String[]
members
A list of UPNs for group members, if any |
|
System.String
groupLogoPath
The path of the logo for the Office 365 Group |
|
System.Boolean
isPrivate
Defines whether the group will be private or public, optional with default false (i.e. public) |
|
System.Boolean
createTeam
Defines whether to create MS Teams team associated with the group |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
|
System.Nullable<Office365Geography>
preferredDataLocation
Defines the codes of geographies in which there is Office 365 presence. Used for multi-geo enabled tenants. List with available geographies is available at https://docs.microsoft.com/office365/enterprise/multi-geo-add-group-with-pdl#geo-location-codes. |
Returns
|
UnifiedGroupEntity
The just created Office 365 Group |
DeleteUnifiedGroup(String, String, Int32, Int32, AzureEnvironment)
Deletes an Office 365 Group (i.e. Unified Group)
Declaration
public static void DeleteUnifiedGroup(string groupId, string accessToken, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
The ID of the Office 365 Group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
GetDeletedUnifiedGroup(String, String, AzureEnvironment)
Gets one deleted unified group based on its ID.
Declaration
public static UnifiedGroupEntity GetDeletedUnifiedGroup(string groupId, string accessToken, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
The ID of the deleted group. |
|
System.String
accessToken
Access token for accessing Microsoft Graph |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
UnifiedGroupEntity
The unified group object of the deleted group that matches the provided ID. |
GetGroupClassification(String, String, AzureEnvironment)
Returns the classification value of an Office 365 Group.
Declaration
public static string GetGroupClassification(string groupId, string accessToken, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
ID of the unified Group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
System.String
Classification value of a Unified group |
GetNestedUnifiedGroupMembers(UnifiedGroupEntity, String, Int32, Int32, AzureEnvironment)
Returns all the Members of an Office 365 group (including nested groups).
Declaration
public static List<UnifiedGroupUser> GetNestedUnifiedGroupMembers(UnifiedGroupEntity group, string accessToken, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
UnifiedGroupEntity
group
|
|
System.String
accessToken
|
|
System.Int32
retryCount
|
|
System.Int32
delay
|
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
List<UnifiedGroupUser>
|
GetUnifiedGroup(String, String, Int32, Int32, Boolean, Boolean, Boolean, AzureEnvironment)
Get an Office 365 Group (i.e. Unified Group) by Id
Declaration
public static UnifiedGroupEntity GetUnifiedGroup(string groupId, string accessToken, int retryCount = 10, int delay = 500, bool includeSite = true, bool includeClassification = false, bool includeHasTeam = false, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
The ID of the Office 365 Group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
System.Boolean
includeSite
Defines whether to return details about the Modern SharePoint Site backing the group. Default is true. |
|
System.Boolean
includeClassification
Defines whether to return classification value of the unified group. Default is false. |
|
System.Boolean
includeHasTeam
Defines whether to check for each unified group if it has a Microsoft Team provisioned for it. Default is false. |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
UnifiedGroupEntity
|
GetUnifiedGroupMembers(UnifiedGroupEntity, String, Int32, Int32, AzureEnvironment)
Returns all the Members of an Office 365 group.
Declaration
public static List<UnifiedGroupUser> GetUnifiedGroupMembers(UnifiedGroupEntity group, string accessToken, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
UnifiedGroupEntity
group
The Office 365 group object of type UnifiedGroupEntity |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
List<UnifiedGroupUser>
Members of an Office 365 group as a list of UnifiedGroupUser entity |
GetUnifiedGroupOwners(UnifiedGroupEntity, String, Int32, Int32, AzureEnvironment)
Returns all the Owners of an Office 365 group.
Declaration
public static List<UnifiedGroupUser> GetUnifiedGroupOwners(UnifiedGroupEntity group, string accessToken, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
UnifiedGroupEntity
group
The Office 365 group object of type UnifiedGroupEntity |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
List<UnifiedGroupUser>
Owners of an Office 365 group as a list of UnifiedGroupUser entity |
GetUnifiedGroups(String, String, String, Int32, Nullable<Int32>, Boolean, Int32, Int32, Boolean, Boolean, Int32, AzureEnvironment)
Returns all the Office 365 Groups in the current Tenant based on a startIndex. IncludeSite adds additional properties about the Modern SharePoint Site backing the group
Declaration
public static List<UnifiedGroupEntity> GetUnifiedGroups(string accessToken, string displayName = null, string mailNickname = null, int startIndex = 0, int? endIndex = null, bool includeSite = true, int retryCount = 10, int delay = 500, bool includeClassification = false, bool includeHasTeam = false, int pageSize = 999, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.String
displayName
The DisplayName of the Office 365 Group |
|
System.String
mailNickname
The MailNickname of the Office 365 Group |
|
System.Int32
startIndex
If not specified, method will start with the first group. |
|
System.Nullable<System.Int32>
endIndex
If not specified, method will return all groups. |
|
System.Boolean
includeSite
Defines whether to return details about the Modern SharePoint Site backing the group. Default is true. |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
System.Boolean
includeClassification
Defines whether or not to return details about the Modern Site classification value. |
|
System.Boolean
includeHasTeam
Defines whether to check for each unified group if it has a Microsoft Team provisioned for it. Default is false. |
|
System.Int32
pageSize
Page size used for the individual requests to Micrsoft Graph. Defaults to 999 which is currently the maximum value. |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
List<UnifiedGroupEntity>
An IList of SiteEntity objects |
GetUnifiedGroupSiteUrl(String, String, Int32, Int32, AzureEnvironment)
Returns the URL of the Modern SharePoint Site backing an Office 365 Group (i.e. Unified Group)
Declaration
public static string GetUnifiedGroupSiteUrl(string groupId, string accessToken, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
The ID of the Office 365 Group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
System.String
The URL of the modern site backing the Office 365 Group |
HasTeamsTeam(String, String, AzureEnvironment)
Does this group have a Teams team?
Declaration
public static bool HasTeamsTeam(string groupId, string accessToken, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
Id of the group to check |
|
System.String
accessToken
Access token with scope Group.Read.All |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
System.Boolean
True if there's a Teams linked to this group |
ListDeletedUnifiedGroups(String, AzureEnvironment)
Lists deleted unified groups.
Declaration
public static List<UnifiedGroupEntity> ListDeletedUnifiedGroups(string accessToken, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
accessToken
Access token for accessing Microsoft Graph |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
List<UnifiedGroupEntity>
A list of unified group objects for the deleted groups. |
ListUnifiedGroups(String, String, String, Int32, Int32, Boolean, Int32, Int32, Boolean, Boolean, AzureEnvironment)
Returns all the Office 365 Groups in the current Tenant based on a startIndex. IncludeSite adds additional properties about the Modern SharePoint Site backing the group
Declaration
public static List<UnifiedGroupEntity> ListUnifiedGroups(string accessToken, string displayName = null, string mailNickname = null, int startIndex = 0, int endIndex = 999, bool includeSite = true, int retryCount = 10, int delay = 500, bool includeClassification = false, bool includeHasTeam = false, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.String
displayName
The DisplayName of the Office 365 Group |
|
System.String
mailNickname
The MailNickname of the Office 365 Group |
|
System.Int32
startIndex
Not relevant anymore |
|
System.Int32
endIndex
Not relevant anymore |
|
System.Boolean
includeSite
Defines whether to return details about the Modern SharePoint Site backing the group. Default is true. |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
System.Boolean
includeClassification
Defines whether or not to return details about the Modern Site classification value. |
|
System.Boolean
includeHasTeam
Defines whether to check for each unified group if it has a Microsoft Team provisioned for it. Default is false. |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
List<UnifiedGroupEntity>
An IList of SiteEntity objects |
PermanentlyDeleteUnifiedGroup(String, String, AzureEnvironment)
Permanently deletes one deleted unified group based on its ID.
Declaration
public static void PermanentlyDeleteUnifiedGroup(string groupId, string accessToken, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
The ID of the deleted group. |
|
System.String
accessToken
Access token for accessing Microsoft Graph |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
RemoveUnifiedGroupMembers(String, String[], String, Int32, Int32, AzureEnvironment)
Removes members from a Microsoft 365 group
Declaration
public static void RemoveUnifiedGroupMembers(string groupId, string[] members, string accessToken, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
Id of the Microsoft 365 group to remove the members from |
|
System.String[]
members
String array with the UPNs of the users that need to be removed as members from the group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
RemoveUnifiedGroupOwners(String, String[], String, Int32, Int32, AzureEnvironment)
Removes owners from a Microsoft 365 group
Declaration
public static void RemoveUnifiedGroupOwners(string groupId, string[] owners, string accessToken, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
Id of the Microsoft 365 group to remove the owners from |
|
System.String[]
owners
String array with the UPNs of the users that need to be removed as owners from the group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
RenewUnifiedGroup(String, String, Int32, Int32, AzureEnvironment)
Renews the Office 365 Group by extending its expiration with the number of days defined in the group expiration policy set on the Azure Active Directory
Declaration
public static void RenewUnifiedGroup(string groupId, string accessToken, int retryCount = 10, int delay = 500, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
The ID of the Office 365 Group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry. |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
RestoreDeletedUnifiedGroup(String, String, AzureEnvironment)
Restores one deleted unified group based on its ID.
Declaration
public static void RestoreDeletedUnifiedGroup(string groupId, string accessToken, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
The ID of the deleted group. |
|
System.String
accessToken
Access token for accessing Microsoft Graph |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
SetUnifiedGroupVisibility(String, String, Nullable<Boolean>, Nullable<Boolean>, AzureEnvironment)
Sets the visibility of a Group
Declaration
public static void SetUnifiedGroupVisibility(string groupId, string accessToken, bool? hideFromAddressLists, bool? hideFromOutlookClients, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
Id of the Microsoft 365 Group to set the visibility state for |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Nullable<System.Boolean>
hideFromAddressLists
True if the group should not be displayed in certain parts of the Outlook UI: the Address Book, address lists for selecting message recipients, and the Browse Groups dialog for searching groups; otherwise, false. Default value is false. |
|
System.Nullable<System.Boolean>
hideFromOutlookClients
True if the group should not be displayed in Outlook clients, such as Outlook for Windows and Outlook on the web; otherwise, false. Default value is false. |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
UpdateUnifiedGroup(String, String, Int32, Int32, String, String, String[], String[], Stream, Nullable<Boolean>, Boolean, AzureEnvironment)
Updates the logo, members or visibility state of an Office 365 Group
Declaration
public static bool UpdateUnifiedGroup(string groupId, string accessToken, int retryCount = 10, int delay = 500, string displayName = null, string description = null, string[] owners = null, string[] members = null, Stream groupLogo = null, bool? isPrivate = null, bool createTeam = false, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Parameters
|
System.String
groupId
The ID of the Office 365 Group |
|
System.String
accessToken
The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
|
System.Int32
retryCount
Number of times to retry the request in case of throttling |
|
System.Int32
delay
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
|
System.String
displayName
The Display Name for the Office 365 Group |
|
System.String
description
The Description for the Office 365 Group |
|
System.String[]
owners
A list of UPNs for group owners, if any, to be added to the site |
|
System.String[]
members
A list of UPNs for group members, if any, to be added to the site |
|
Stream
groupLogo
The binary stream of the logo for the Office 365 Group |
|
System.Nullable<System.Boolean>
isPrivate
Defines whether the group will be private or public, optional with default false (i.e. public) |
|
System.Boolean
createTeam
Defines whether to create MS Teams team associated with the group |
|
AzureEnvironment
azureEnvironment
Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
Returns
|
System.Boolean
Declares whether the Office 365 Group has been updated or not |