Share via

unable to delete policy

Glenn Maxwell 13,721 Reputation points
2024-11-30T05:13:38.5733333+00:00

Hi All,

I have created the following policy using the syntax below. I assigned this policy to a couple of users, but I am unable to delete it because it is still assigned to some users. How can I remove the users from this policy and delete the policy? Please guide me, as I am encountering an error while trying to delete the policy.

New-CsApplicationAccessPolicy -identity Policy1 -AppIds "clientid" 
Grant-CsApplicationAccessPolicy -PolicyName Policy1 -Identity "user-objectid1"

Remove-CsApplicationAccessPolicy "Policy1" 

Remove-CsApplicationAccessPolicy : The policy "Policy1" is currently assigned to one or more users or groups. Ensure policy is not assigned before removing.
Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

Windows for business | Windows Server | User experience | PowerShell
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments

Answer accepted by question author

  1. Rich Matheisen 48,116 Reputation points
    2024-11-30T19:20:44.5566667+00:00

    Remove the policy from the user(s) before trying to remove the policy itself.

    Grant-CsApplicationAccessPolicy -Identity "UserIdentity" -PolicyName $Null
    

    Was this answer helpful?

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.