Commands › Microsoft Teams

Remove-CsExternalAccessPolicy

Microsoft Teams MicrosoftTeams Remove-*

Enables you to remove an existing external access policy.

Quick start script

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

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-CsExternalAccessPolicy
$before | Format-List

# 3. Make the change (dry run first)
Remove-CsExternalAccessPolicy -Identity <XdsIdentity> -WhatIf
Remove-CsExternalAccessPolicy -Identity <XdsIdentity>

# 4. Verify and diff
$after = Get-CsExternalAccessPolicy
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Remove-CsExternalAccessPolicy [-Tenant <Guid>] [-Identity] <XdsIdentity> [-Force] [-WhatIf] [-Confirm]
 [<CommonParameters>]

Parameters (5)

ParameterTypeRequiredWhat it controls
-Confirm SwitchParameter Prompts you for confirmation before executing the command.
-Force SwitchParameter Suppresses the display of any non-fatal error message that might occur when running the command.
-Identity XdsIdentity yes Unique identifier for the external access policy to be removed. External access policies can be configured at the global, site, or per-user scopes. To "remove" the global policy, use this syntax: `-Identity global`....
-Tenant Guid Globally unique identifier (GUID) of the Skype for Business Online tenant account for whom the external access policy is being removed. For example:
-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.