Commands › Microsoft Teams
Grant-CsExternalAccessPolicy
Enables you to assign an external access policy to a user or a group of users.
Quick start script
# Grant-CsExternalAccessPolicy — 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-CsExternalAccessPolicy -Global <SwitchParameter> -Group <String> -Identity <UserIdParameter> | Format-List
# 3. Export for evidence / drift tracking
Grant-CsExternalAccessPolicy | Export-Clixml .\CsExternalAccessPolicy-$(Get-Date -Format yyyyMMdd).xml
Syntax — 4 parameter sets
Identity (Default)
Grant-CsExternalAccessPolicy [<CommonParameters>]
GrantToUser
Grant-CsExternalAccessPolicy [-Identity] <String> [[-PolicyName] <String>] [<CommonParameters>]
GrantToGroup
Grant-CsExternalAccessPolicy [[-PolicyName] <String>] [-Group] <String> [-Rank] <Int32> [<CommonParameters>]
GrantToTenant
Grant-CsExternalAccessPolicy [[-PolicyName] <String>] [-Global] [-Force] [<CommonParameters>]
Parameters (8)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.