Announcement

Collapse
No announcement yet.

Execute Registry key to multiple machine

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Execute Registry key to multiple machine

    Hi,

    Can someone help me to create a script that deploy a registry key silently to multiple machine without user interaction? What is needed to be done is to enalbe SNMP on each machine for management/monitoring purpose.

    Thank you very much,

    Sovath

  • #2
    Re: Execute Registry key to multiple machine

    What key is it, what are the settings?

    Found these threads in this forum, that can help you starting
    - http://forums.petri.com/showthread.php?t=10576
    - http://forums.petri.com/showthread.php?t=15561



    It is also possible to edit a registry key remotely, on all clients that are connectable At that time.

    'quick sample
    '-----------------------------------------------------------------------
    Const HKEY_LOCAL_MACHINE = &H80000002

    strComputer = "ComputerName"

    Set objReg = GetObject("winmgmts:{impersonationLevel= impersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")

    '( create or change a REG_SZ value: )
    objReg.SetStringValue HKEY_LOCAL_MACHINE, keypath, entryName1, value1
    objReg.SetStringValue HKEY_LOCAL_MACHINE, keypath, entryName2, value2
    '-----------------------------------------------------------------------

    To retrieve the computernames of all the clients, the script can query an OU in the Active Directory.


    \Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: Execute Registry key to multiple machine

      Another manual way to do it is to open regedit, select File... Connect Network Registry for each computer, then you can select File... Import and select your registry file and you'll get a prompt to import the file into each "connected" registry.

      Comment


      • #4
        Re: Execute Registry key to multiple machine

        I'm talking about a VBS script that add registry key file that I have to 100 of 100 of servers in the data center. A script that execute this reg key without user's confirmation.

        THanks.

        Comment


        • #5
          Re: Execute Registry key to multiple machine

          As I mensioned, the script can read a list of computer names, query the Active Directory or can enumerate the computers in one OU or in a Group. Tell us where to find/get the names of the computers.

          example:
          Code:
          Const HKEY_LOCAL_MACHINE = &H80000002
          
          DIM strOU
          strOU = "ou=Servers,ou=Our Computers,dc=Domain,dc=Local"
          
          On Error Resume Next
          
          'Bind to the OU, enumerate computerobjects
          
          Set colItems = GetObject("LDAP://" & strOU ):colItems.Filter=Array("Computer")
          
          'loop
          For Each objItem in colItems
          
             strComputer = objItem.cn
          
             'Connect to remote computer's System Registry Provider.
             '(defined methods: msdn.microsoft.com/en-us/library/aa393664(VS.85).aspx)
          
             'Variables...
              keypath1 = "System\CurrentControlSet\Services\SNMP"
              entryName1 = "TEST REMS"
              value1 = "test test"
          
              Set objReg = GetObject("winmgmts:{impersonationLevel= impersonate}!\\" & _
                      strComputer & "\root\default:StdRegProv")
          
             'create or change a REG_SZ value
              eReturn = objReg.SetStringValue(HKEY_LOCAL_MACHINE, keypath1, entryName1, value1)
          
          Next
          
          Wscript.Quit
          To create a key:
          eReturn = objReg.CreateKey(HKEY_LOCAL_MACHINE, keypath1)

          \Rems

          This posting is provided "AS IS" with no warranties, and confers no rights.

          __________________

          ** Remember to give credit where credit's due **
          and leave Reputation Points for meaningful posts

          Comment


          • #6
            Re: Execute Registry key to multiple machine

            There will be a long list of computer (win2k3) in the data center. There are about 2 thousands servers. And the reg key file is in the server where the script will be executed. My question is when the script is executed, will it call the list of the machines and the reg key, is that correct?

            Thanks a million for your help.

            Comment

            Working...
            X