How to delete an Instance (AssignedAccess) when applied via MDM WMI bridge Provider

Ensure before proceeding that the $namespaceName and $className are correctly reference as it relates to your environment.

For all device settings, the WMI Bridge client must be executed under local system user (Administrator). To do that, download the psexec tool from https://technet.microsoft.com/sysinternals/bb897553.aspx and run psexec.exe -i -s cmd.exe from an elevated admin command prompt.

Delete existing instance
{
$obj = Get-CimInstance -Namespace $namespaceName -ClassName $className -Filter "ParentID='./Vendor/MSFT/Policy/Config' and InstanceID='AssignedAccess'"
Remove-CimInstance -CimInstance $obj
}

Ensure the right Instance ID is referenced. To see how this is done for Local account AssignedAccess, see https://techdirectarchive.com/2020/01/24/how-to-use-powershell-to-clear-assignedaccess/

To see how this command can be used to create, enumerate, query and modify an instance, see the following link and customise it to your need https://docs.microsoft.com/en-us/windows/client-management/mdm/using-powershell-scripting-with-the-wmi-bridge-provider

Kindly leave a commend below if you found other methods that worked.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s