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. Id of the Microsoft 365 group to add the members to |
System. String array with the UPNs of the users that need to be added as members to the group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. 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. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. Id of the Microsoft 365 group to add the owners to |
System. String array with the UPNs of the users that need to be added as owners to the group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. 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. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. Id of the Microsoft 365 group to remove all the current members of |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. Id of the Microsoft 365 group to remove all the current owners of |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. The ID of the Office 365 Group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Time to wait till Team is created. Default is 300 seconds (5 mins) |
Azure 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. The Display Name for the Office 365 Group |
System. The Description for the Office 365 Group |
System. The Mail Nickname for the Office 365 Group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. A list of UPNs for group owners, if any |
System. A list of UPNs for group members, if any |
Stream
groupLogo
The binary stream of the logo for the Office 365 Group |
System. Defines whether the group will be private or public, optional with default false (i.e. public) |
System. Defines whether to create MS Teams team associated with the group |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. 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. Option to prevent sending of default welcome emails to new members. |
System. The SharePoint site URL alias, if not specified mailNickName will be used |
System. 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
Unified 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. The Display Name for the Office 365 Group |
System. The Description for the Office 365 Group |
System. The Mail Nickname for the Office 365 Group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. A list of UPNs for group owners, if any |
System. A list of UPNs for group members, if any |
System. Defines whether the group will be private or public, optional with default false (i.e. public) |
System. Defines whether to create MS Teams team associated with the group |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. 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
Unified 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. The Display Name for the Office 365 Group |
System. The Description for the Office 365 Group |
System. The Mail Nickname for the Office 365 Group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. A list of UPNs for group owners, if any |
System. A list of UPNs for group members, if any |
System. The path of the logo for the Office 365 Group |
System. Defines whether the group will be private or public, optional with default false (i.e. public) |
System. Defines whether to create MS Teams team associated with the group |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. 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
Unified 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. The ID of the Office 365 Group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. The ID of the deleted group. |
System. Access token for accessing Microsoft Graph |
Azure 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
Unified 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. ID of the unified Group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
Azure 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. 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
Unified
|
System.
|
System.
|
System.
|
Azure 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<Unified
|
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. The ID of the Office 365 Group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
System. Defines whether to return details about the Modern SharePoint Site backing the group. Default is true. |
System. Defines whether to return classification value of the unified group. Default is false. |
System. Defines whether to check for each unified group if it has a Microsoft Team provisioned for it. Default is false. |
Azure 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
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
Unified The Office 365 group object of type UnifiedGroupEntity |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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<Unified 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
Unified The Office 365 group object of type UnifiedGroupEntity |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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<Unified 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. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. The DisplayName of the Office 365 Group |
System. The MailNickname of the Office 365 Group |
System. If not specified, method will start with the first group. |
System. If not specified, method will return all groups. |
System. Defines whether to return details about the Modern SharePoint Site backing the group. Default is true. |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
System. Defines whether or not to return details about the Modern Site classification value. |
System. Defines whether to check for each unified group if it has a Microsoft Team provisioned for it. Default is false. |
System. Page size used for the individual requests to Micrsoft Graph. Defaults to 999 which is currently the maximum value. |
Azure 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<Unified 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. The ID of the Office 365 Group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. 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. Id of the group to check |
System. Access token with scope Group.Read.All |
Azure 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. 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. Access token for accessing Microsoft Graph |
Azure 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<Unified 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. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. The DisplayName of the Office 365 Group |
System. The MailNickname of the Office 365 Group |
System. Not relevant anymore |
System. Not relevant anymore |
System. Defines whether to return details about the Modern SharePoint Site backing the group. Default is true. |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
System. Defines whether or not to return details about the Modern Site classification value. |
System. Defines whether to check for each unified group if it has a Microsoft Team provisioned for it. Default is false. |
Azure 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<Unified 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. The ID of the deleted group. |
System. Access token for accessing Microsoft Graph |
Azure 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. Id of the Microsoft 365 group to remove the members from |
System. String array with the UPNs of the users that need to be removed as members from the group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. Id of the Microsoft 365 group to remove the owners from |
System. String array with the UPNs of the users that need to be removed as owners from the group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
Azure 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. The ID of the Office 365 Group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry. |
Azure 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. The ID of the deleted group. |
System. Access token for accessing Microsoft Graph |
Azure 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. Id of the Microsoft 365 Group to set the visibility state for |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. 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. 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. |
Azure 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. The ID of the Office 365 Group |
System. The OAuth 2.0 Access Token to use for invoking the Microsoft Graph |
System. Number of times to retry the request in case of throttling |
System. Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry |
System. The Display Name for the Office 365 Group |
System. The Description for the Office 365 Group |
System. A list of UPNs for group owners, if any, to be added to the site |
System. 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. Defines whether the group will be private or public, optional with default false (i.e. public) |
System. Defines whether to create MS Teams team associated with the group |
Azure 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. Declares whether the Office 365 Group has been updated or not |