Solved

vb script modify registry key on all computers for all users

Posted on 2014-09-20
4
61 Views
Last Modified: 2015-03-19
Given

Dim strDescription
 
Const ADS_SCOPE_SUBTREE = 1000
 
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand =   CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
 
Set objCOmmand.ActiveConnection = objConnection
objCommand.CommandText = _
    "Select Name, Location, Description from 'LDAP://DC=icebox,DC=local' Where objectClass='computer'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE  
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
 
Wscript.Echo "Computer Name"
 
do Until objRecordSet.EOF
 
' enter code here
WScript.Echo objRecordSet.Fields("Name").Value

objRecordSet.MoveNext
loop

I need to loop through all users no hkcu on all computers and change key xy value to 3 from sbs 2011 server

thanks
0
Comment
Question by:HalCHub
  • 2
  • 2
4 Comments
 
LVL 43

Expert Comment

by:Steve Knight
ID: 40335048
Have you thought of using group policy so they get setting when policy refreshes, or even just add to login script if hkcu so it can run as the user?
0
 
LVL 1

Author Comment

by:HalCHub
ID: 40335654
what would I put in the login script ?
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 40335666
You can use a .REG fil exported from the registry key in question with regedit command or use a REG.exe command, e.g.

reg add HKCU\key\key /v Value /t REG_DWORD /d 3

Obviously don't know what you are trying to add but if you can give an example by showing a screen short, or export to a .reg file (right click in regedit and export)

Depending upon what the key is there might already been a policy you can just set and push down to the clients automatically or create a new one too.

Steve
0
 
LVL 1

Author Comment

by:HalCHub
ID: 40335788
I am using a login script and will give it try.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Title # Comments Views Activity
Excel copy picture into Outlook email 7 65
change the windows script file to BAT 10 49
VBScript on Html 15 47
asp classic find word in string and get its value 6 21
Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…

829 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