Solved

VBS script to delete all the Windows 7 user profiles and user registry values when the PCs shut down

Posted on 2014-10-27
4
713 Views
Last Modified: 2014-12-21
Hi

We have 4, IT suites and 40 PCs on each of IT rooms. On each PC many students login each day and log out. In the evening the PCs shutdown.

Please could someone post me a VBS script to delete all the Windows 7 profiles when the PCs shut down? I am planning to create GPO and point the script under- Computer Configuration-Policies-Scripts-Shutdown.

Also want to make sure that the script clears the registry values of the deleted profile, so that when the same user logs into the same PC next day, they don’t get a profile error message.
Also want exception for Administrator, All users, default user, public, and default on the script.

Once I get some tutorials I will copy the VBS script to the C:\users   location and do a CScript from the command prompt to make sure it works and then copy to the GPO.

Any help will be really helpful, Thanks in advance.
0
Comment
Question by:lianne143
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 22

Assisted Solution

by:Joseph Moody
Joseph Moody earned 250 total points
ID: 40406739
Are you wanting to just clean up user profiles? if so, you can clean up old profiles with the user profile clean up service: http://deployhappiness.com/user-profile-cleanup-with-group-policy/
0
 

Author Comment

by:lianne143
ID: 40407030
We use local profiles  and our windows 7 PCs Hard disk is only 80Gb and was concerned about C drive eating up the space with user profiles. We don't keep any information on the local profiles.
I have now created a GPO and set to  a value to delete user profile older than 1 days. I will restart the PCs on the OU tomorrow where this policy has been applied and I will post tomorrow as how it goes.
I hope this policy clears the registry values as well of the deleted profile, so that when the same student  logs into the same PC next day, they don’t get a profile error message (You’ve Been Signed In With A Temporary Profile)

Thanks
0
 
LVL 70

Accepted Solution

by:
Qlemo earned 250 total points
ID: 40482752
Mandatory profiles come into mind here. They are usually located on a network share, but http://oakdome.com/k5/tutorials/windows-7-mandatory-roaming-profile.php shows how you can do locally and by setting a .Default profile as mandatory.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question