Solved

Group Policy, push out a Batch file

Posted on 2007-04-09
11
2,096 Views
Last Modified: 2008-09-18
I am running Windows Server 2003 (SP1) and it is the DC.  I am also new to Active Directory and setting up Group Policys.  I have a program that I would like to install on all the PCs on the network and have a batch fie setup to run the install, it has been tested and runs fine.  (I tried doing a MSI and found the batch file is the easiest way due to how the program's install is setup.)  This batch file only needs to run one time   I haven't found instructions that I am 100% confident in on how to use Group Policy to deploy this batch file.  Can someone give me step by step instructions on how to do this?  Or is there another way I should be doing this?
0
Comment
Question by:lunchbyte
[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
  • 6
  • 5
11 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18875583
Setup your batch file like this:

@echo off
If exist c:\Program.flg goto :eof
::your code to call the install
echo Installed > c:\Program.flg

The first time it's called, it'll skip over the first line (excluding the @echo off) - and will call your install routine.
Then, it'll write a flag file to the root of c: - the next time it runs, it'll check for that flag file before proceeding - if it exists, it'll just exit the script.
0
 
LVL 5

Author Comment

by:lunchbyte
ID: 18875858
Thanks for the code to add the flag file. Very helpful.  Just need the instructions on adding it to Group Policy and I'm set.  Thanks again.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18875877
Right-click your domain, choose properties.
You'll want to click Edit there
The scripts are located under User Configuration, Windows Settings, Scripts, Logon Scripts...drop a reference to your batch file there.
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 5

Author Comment

by:lunchbyte
ID: 18876071
I guess this is where I'm getting tripped up.  When I right click on my domain in Group Policy Management then properties I have two tabs, General & Manage by.  I do not have an option to click on Edit under either tab.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18876088
Open up Active Directory Users & Computers (Start->Run->Dsa.msc if you have the admin tools installed or are on a DC).
Now, right-click your domain, and choose properties
Under the Group Policy tab, do you have any GPOs listed?
You can choose to edit one there, or edit the default domain policy...
0
 
LVL 5

Author Comment

by:lunchbyte
ID: 18876332
Under Active Directory User & computers when I get to the Group Policy tab it says the Group Policy snap-in has been installed, so the tab is no longer used.  From there I have the open button which opens Group Policy Management.

By the way, I'll max out the points on this.  Thanks for the help.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18876394
Hmm - I'm not really sure on that...I'm not the group policy-guru 'round here...perhaps another expert will be able to guide you on that.  I've always used Aduc when modifying my polices...
0
 
LVL 5

Author Comment

by:lunchbyte
ID: 18877175
I think I found it, is the window I need to be in called Group Policy Object Editor?  If it is, all I did was right click on 'my default policy' and clicked on edit.  From there I found what you posted in your second comment.

This seem obvious but, if I want the script to run on each computer I would put it under computer configuration, correct?  What I'm installing is a software inventory program and want to know what is on each system and really doesn't matter who the user is.
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18877186
Depends...computer config runs outside of the user's contect - useful for when your users won't have rights to install software...(known as 'startup' scripts) - otherwise, logon scripts are under user config...
0
 
LVL 5

Author Comment

by:lunchbyte
ID: 18877915
Thanks a ton for the help.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18877928
Glad I could assist you.  Thanx for the grade! :^)
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

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
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 …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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