Solved

vb script modify registry key on all computers for all users

Posted on 2014-09-20
4
58 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
Comment Utility
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
Comment Utility
what would I put in the login script ?
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
Comment Utility
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
Comment Utility
I am using a login script and will give it try.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Welcome to part one of a multi-part tutorial series, VBScript for Windows System Administrators.  The goal of this series is to teach non-programmers how to write useful VBS code to automate their environment, and perform tasks faster, and in a more…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now