Commands › Exchange Online

Add-VivaModuleFeaturePolicy

Exchange Online ExchangeOnlineManagement Add-*

2.0 or later. For more information, see About the Exchange Online PowerShell module. Use the Add-VivaModuleFeaturePolicy cmdlet to add a new access policy for a specific feature in Viva. The attributes of the policy are defined using the cmdlet parameters. Policies are used to restrict or grant access to the specified feature for specific users, groups, or the entire tenant. - You can assign up to 10 policies per feature. An additional one policy per feature can be assigned to the entire tenant. - Policies assigned to a specific user or group take priority over the policy assigned to the entir

Quick start script

# Add-VivaModuleFeaturePolicy — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Add-VivaModuleFeaturePolicy -FeatureId <String> -IsFeatureEnabled <Boolean> -ModuleId <String> | Format-List

# 3. Export for evidence / drift tracking
Add-VivaModuleFeaturePolicy | Export-Clixml .\VivaModuleFeaturePolicy-$(Get-Date -Format yyyyMMdd).xml

Syntax

Add-VivaModuleFeaturePolicy -FeatureId <String> -IsFeatureEnabled <Boolean> -ModuleId <String> -Name <String>
 [-Confirm]
 [-Everyone]
 [-GroupIds <String[]>]
 [-IsUserControlEnabled <Boolean>]
 [-IsUserOptedInByDefault <Boolean>]
 [-ResultSize <Unlimited>]
 [-UserIds <String[]>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (12)

ParameterTypeRequiredWhat it controls
-FeatureId String yes The FeatureId parameter specifies the feature in the Viva module that you want to add the policy for.
-IsFeatureEnabled Boolean yes The IsFeatureEnabled parameter specifies whether or not the feature is enabled by the policy. Valid values are:
-ModuleId String yes The ModuleId parameter specifies the Viva module that you want to add the feature policy for.
-Name String yes The Name parameter specifies the name of the policy. The maximum length is 256 characters. If the value contains spaces, enclose the value in quotation marks (").
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-Everyone SwitchParameter The Everyone switch specifies that the policy applies to all users in the organization. You don't need to specify a value with this switch.
-GroupIds String[] The GroupIds parameter specifies the email addresses or security group object IDs (GUIDs) of groups that the updated policy applies to. Both [Mail-enabled and non-mail-enabled Microsoft Entra...
-IsUserControlEnabled Boolean **Note**: This parameter is available in module version 3.3.0-Preview1 or later.
-IsUserOptedInByDefault Boolean **Note**: This parameter is available in module version 3.8.0-Preview2 or later.
-ResultSize Unlimited This parameter is reserved for internal Microsoft use.
-UserIds String[] The UserIds parameter specifies the user principal names (UPNs) of the users that the policy applies to. You can enter multiple values separated by commas.
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.