Solved

Run script once using group policy

Posted on 2014-07-18
5
4,673 Views
Last Modified: 2014-07-28
Hello,

I would like to run a script (or batch file) once (per user or computer, whichever is easier)) preferably using group policy.

The script is to delete a registry key and its subkeys.

The environment consists of Windows 7 client workstations connected to a Windows 2003 Active directory network.

I would like to delete this key once per computer

HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles

Can this be done? If so, how?

Thanks in advance.

Mark
0
Comment
Question by:mbudman
[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
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Gabriel Clifton
ID: 40204556
You could use group policy to write a registry key to add the script to runonce and have that policy apply and not get reapplied.
0
 
LVL 1

Author Comment

by:mbudman
ID: 40204575
The problem is that "runonce" is not executed when someone connects to network via VPN.

All I would like to do is run delete a registry key once per computer.

The registry key in question contains the configuration information for a particular program. If the key is deleted (or does not exist), the program automatically runs the set up wizard, which is what I want to happen.

However, I do not want the set up wizard to run all the time - just once per computer.
0
 
LVL 13

Expert Comment

by:Gabriel Clifton
ID: 40204587
Ok, I am really not familiar with networks via VPN so do scheduled tasks work across the VPN? If so then use group policy to create a scheduled task that executes once.
0
 
LVL 4

Accepted Solution

by:
Neeraj Kumar earned 500 total points
ID: 40204690
You can use below mentioned command to delete a registry key via group policy . Put the same in login script or machine startup script.

reg delete "HKCU\Some\Registry\Path" /f

Also you can use group policy preference options from Win7 machine as your DC is windows 2003 to delete the registry key.

You can refer below mentioned article

http://social.technet.microsoft.com/Forums/en-US/a48b08db-b1a8-43db-90f8-ec785b9af9d7/set-and-remove-registry-keys-using-gpo?forum=winserverGP
0
 
LVL 1

Author Closing Comment

by:mbudman
ID: 40225230
Thank you for your assistance.
0

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
Here's a look at newsworthy articles and community happenings during the last month.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

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