Solved

Run script once using group policy

Posted on 2014-07-18
5
4,454 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
powershell mailbox move question 8 50
Configuring DNS Round Robin in Windows DNS server ? 8 75
Decommissioning DNS server question 3 36
DNS/WINS in a domain 10 47
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

733 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