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
557 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 21

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…

706 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

17 Experts available now in Live!

Get 1:1 Help Now