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
632 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 69

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
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 tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

828 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