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
580 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
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 68

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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…

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now