Forum Discussion

RobYoung's avatar
RobYoung
Brass Contributor
Sep 23, 2021

Cleanup Intune profiles and policies

We have come across an issue where a desktop support person was logging into each windows device that they were deploying which assigned them as the primary user on the device.  I ran a script to switch the primary user to the last logged on user which cleaned up the devices and assigned them corrcetly but now the polcies and profiles are a mess.  Most of our polcies and profiles are user based and when I changed the primary user, it left his polcies and profiles on the device.

How do I purge their policies and profiles on these devices.  could it be his work profile is also still assigned on this device?

  • Hi,
    Hi, good morning
    Intune profiles--> Windows profiles.. When a user logs in a device... and even when the user is removed the old profile just sits and stays there on the device...
    If there is data in it you want to remove, create a powershell script which tries to find the specific user folder first... if it exists... it removes it... (as the userprofile also contains the policies/register settings.. they are also removed)
    Or did I get the question wrong 🙂 ?
    • RobYoung's avatar
      RobYoung
      Brass Contributor
      I didnt think the user profile on the machine was associated with the intune Device Compliance, Device COnfig, and ES Config. I went ahead and pulled the previous user profile off the machine and performed a sync, but the policies and configurations are still applying.
      • It depends on what was configured..

        Device policies...
        User policies

        Could you take a look at what registry keys are still present inside the policymanager registry key?