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
684 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

739 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