Commands › Microsoft Teams

Grant-CsOnlineVoicemailPolicy

Microsoft Teams MicrosoftTeams Grant-*

Assigns an online voicemail policy to a user account, to a group of users, or set the tenant Global instance. Online voicemail policies manage usages for Voicemail service.

Quick start script

# Grant-CsOnlineVoicemailPolicy — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Run and inspect
Grant-CsOnlineVoicemailPolicy -Group <String> | Format-List

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

Syntax — 3 parameter sets

GrantToTenant (Default)

Grant-CsOnlineVoicemailPolicy [[-PolicyName] <string>] [-Global] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

GrantToGroup

Grant-CsOnlineVoicemailPolicy [-Group] <string> [[-PolicyName] <string>] [-PassThru] [-Rank <int>] [-WhatIf] [-Confirm] [<CommonParameters>]

Identity

Grant-CsOnlineVoicemailPolicy [[-Identity] <string>] [[-PolicyName] <string>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters (8)

ParameterTypeRequiredWhat it controls
-Confirm SwitchParameter Prompts you for confirmation before executing the command.
-Global SwitchParameter Sets the parameters of the Global policy instance to the values in the specified policy instance.
-Group String yes Specifies the group used for the group policy assignment.
-Identity String The Identity parameter represents the ID of the specific user in your organization; this can be either a SIP address or an Object ID.
-PassThru SwitchParameter Enables you to pass a user object through the pipeline that represents the user being assigned the policy. By default, the Grant-CsOnlineVoicemailPolicy cmdlet does not pass objects through the pipeline.
-PolicyName String A unique identifier(name) of the policy.
-Rank Int32 The rank of the policy assignment, relative to other group policy assignments for the same policy type.
-WhatIf SwitchParameter Describes what would happen if you executed the command without actually executing the command.

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