Solved

vb script modify registry key on all computers for all users

Posted on 2014-09-20
4
64 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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

630 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