vb script modify registry key on all computers for all users

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
LVL 1
HalCHubAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Steve KnightConnect With a Mentor IT ConsultancyCommented:
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
 
Steve KnightIT ConsultancyCommented:
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
 
HalCHubAuthor Commented:
what would I put in the login script ?
0
 
HalCHubAuthor Commented:
I am using a login script and will give it try.
0
All Courses

From novice to tech pro — start learning today.