Delete User Profile Using GPO

I. Delete cached copies of roaming profiles when user logs off.

If you enable Group Policy, any local copy of a user's roaming profile is deleted when the user logs off. However, the roaming profile still remains on the network server that stores it.

You can configure a Group Policy Object (GPO) to perform the preceding behavior by performing the following steps:
  1. Edit the GPO that you want to modify.
  2. Locate the following section: Computer Configuration \ Administrative Templates \ System \ User Profiles.
  3. Double-click Delete cached copies of roaming profiles (the Group Policy setting).
  4. Click Enabled.

NOTE: The preceding steps involve a computer configuration setting. When Group Policy is applied to a container, such as an organizational unit, it can apply to all computers in that organizational unit and not necessarily to all users in that organizational unit. For example, if a user in the organizational unit that has this policy, logs on to a computer that is in another organizational unit that does not have this policy, a copy of the roaming profile can remain on the computer. Once this policy is applied to a computer it applies to all users that use that computer.


II. Delete user profiles older than a specified number of days on system restart


The "Delete user profiles older than a specified number of days on system restart" Group Policy is a new Group Policy in Windows Vista or later version. When you configure the setting of this Group Policy and then restart the computer, the Group Policy may delete user profiles.

You can configure a Group Policy Object (GPO) to perform the preceding behavior by performing the following steps:

  1. Edit the GPO that you want to modify.
  2. Locate the following section: Computer Configuration \ Administrative Templates \ System \ User Profiles.
  3. Double-click Delete user profiles older than a specified number of days on system restart.
  4. Click Enabled.
  5. Specify no of days.

After you enable this Group Policy, the Group Policy enables the User Profiles service. When you restart the computer and then log on to the computer by using a user account that is a member of the administrators group, the User Profiles service deletes user profiles that have not been used within a specified number of days.

Note One day is interpreted as being 24 hours after a specific user profile was most recently accessed.

If you disable this Group Policy, or if you do not configure the setting of this Group Policy, the User Profiles service does not delete any user profiles when you restart the computer.