unable to delete policy

Glenn Maxwell 11,841 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.
Microsoft Exchange Online
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,456 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,625 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,400 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,576 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 47,391 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
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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