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
Solved

Using the WSHController Deployment method

Posted on 2006-10-31
3
310 Views
Last Modified: 2012-06-21
I need to copy the C:\windows\system32\GroupPolicy folder from the model computer and deploy that lgpo to several other XP computers.  Then I need to run the gpupdate /force on those computers.  Please provide the steps and script for this.  **I am not a scripting guy so I will need as much detail as possible to complete this task.  Thank you!!**
0
Comment
Question by:samiam41
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
royce2020 earned 500 total points
ID: 17845787
If i was doing this, assuming all the comuters are networked, I'd have two scripts, one that copys the file, and a second one that tells the remote computer to run the frist one. Note that I don't know what file you're planing on copying, I've assumed that it's been copyed to \\server\public\group.grp and is destined for the users c:\windows\system32\ folder. Also, all the computes need to have administrative WMI turned on, you can do this by including the command "netsh firewall set service RemoteAdmin enable" (without the quotes) in their login script, and turned off again with "netsh firewall set service RemoteAdmin disable".

First script, save this in \\server\public\copy.vbs (for example):

Set fs = WScript.CreateObject("Scripting.FileSystemObject")
fs.copyfile "\\server\public\group.grp" "c:\windows\system32\"

Second script, run this as a domain administrator:

Function RunRemote (strCommand,strcomputer)
      Const OverwriteExisting = True
      
      strNamespace = "root\cimv2"

      Set objWMIService = GetObject ("winmgmts:\\" & strComputer & "\" & strNamespace & ":Win32_Process")
      Error = objWMIService.Create (strCommand, null, null, intProcessID)
      RunRemote = error
End function

arrNames = array("computer1","computer2")

for i = 0 to ubound(arrNames)-1
        nme = arrNames(i)
        x = runRemote ("\\server\public\copy.vbs",nme)
next

msgbox "done"
0
 
LVL 9

Author Comment

by:samiam41
ID: 17849924
Royce-  Thanks for the script.  I will be testing this out and will let you know what I find out.  
0
 
LVL 9

Author Comment

by:samiam41
ID: 17906958
Great work.  Sorry for the delay.  I have been out with the flu.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This is an explanation of a simple data model to help parse a JSON feed

840 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