Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vb script modify registry key on all computers for all users

Posted on 2014-09-20
4
Medium Priority
?
65 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
[X]
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
  • 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 2000 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: 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

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

722 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