script to run on multiple workstations

Home Forums Scripting General Scripting script to run on multiple workstations

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #142795

    Hi Guys,

    I’m pretty new to scripts.

    I have managed to get this script to run on 1 workstation , but I need it to run on about 70 in total.

    How would I get this to run say from a list.txt so I could add the workstation names into the list.
    Also how would go about logging which are successful and which have failed.

    Here’s what I have

    Moderator edit: added code-tags around the batch[COLOR=#555a5f][FONT=Verdana]@echo off[/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]copy c:msup.reg \hostamec$[/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana] [/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]rem stop automatic updates service[/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]sc \hostname stop wuauserv[/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]sleep 10[/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]rem delete registry entries[/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]psexec \hostname regedit /s c:msup.reg[/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]rem start automatic updates service[/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]sc \hostname start wuauserv[/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]exit[/FONT][/COLOR][/CODE]
    [COLOR=#555a5f][FONT=Verdana] [/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]This is basically to resolve an issue with WSUS on the workstations.[/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana] [/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana] [/FONT][/COLOR]
    [COLOR=#555a5f][FONT=Verdana]Thanks in advance[/FONT][/COLOR][CODE] @echo off
    copy c:msup.reg \hostamec$

    rem stop automatic updates service
    sc \hostname stop wuauserv
    sleep 10
    rem delete registry entries
    psexec \hostname regedit /s c:msup.reg
    rem start automatic updates service
    sc \hostname start wuauserv
    exit[/CODE]

    This is basically to resolve an issue with WSUS on the workstations.


    Thanks in advance

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.