WMI Question 
Author Message
 WMI Question

I have a script that I would like users to execute that
writes entries the HKLM key in the registry. None of the
users will have local admin permissions (granting the
permissions is not an option), so I decided that WMI is
the way to go...

This script will launch the process locally (but not as
admin):

Set Process = GetObject("winmgmts://" & "PCName"_
& "/root/cimv2").Get("Win32_Process")
Process.Create "WScript.exe C:\Script.vbs"

This script will execute it remotely using the local admin
account, but will not work locally:

Set LocatorObject = CreateObject_
("WBEMScripting.SWBEMLocator")
Set ProcessObject = LocatorObject.ConnectServer_
("PCName",, "PCName\Local Admin", "Password")
Set InstanceObject = ProcessObject.Get("Win32_Process")
InstanceObject.Create "WScript.exe C:\Script.vbs"

Please help!!!

Steve



Mon, 27 Sep 2004 23:26:12 GMT  
 WMI Question
Have you tried the WMI registry manipulation convention ?
Set oReg=GetObject("winmgmts:!root/default:StdRegProv")
Maybe there is some issue running your vbs script, if
youuse wmi to mod the reg you may not have the same
permission issues.

Quote:
>-----Original Message-----
>I have a script that I would like users to execute that
>writes entries the HKLM key in the registry. None of the
>users will have local admin permissions (granting the
>permissions is not an option), so I decided that WMI is
>the way to go...

>This script will launch the process locally (but not as
>admin):

>Set Process = GetObject("winmgmts://" & "PCName"_
>& "/root/cimv2").Get("Win32_Process")
>Process.Create "WScript.exe C:\Script.vbs"

>This script will execute it remotely using the local
admin
>account, but will not work locally:

>Set LocatorObject = CreateObject_
>("WBEMScripting.SWBEMLocator")
>Set ProcessObject = LocatorObject.ConnectServer_
>("PCName",, "PCName\Local Admin", "Password")
>Set InstanceObject = ProcessObject.Get("Win32_Process")
>InstanceObject.Create "WScript.exe C:\Script.vbs"

>Please help!!!

>Steve
>.



Tue, 28 Sep 2004 21:32:36 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. WMI Question

2. WMI Question

3. WMI Question

4. WMI Question

5. WMI question

6. WMI Question

7. WMI questions

8. WMI question

9. Scripting-Newbie question - WMI

10. Scripting newbie question on WMI

11. WMI impersonation question

12. Novice Question: Using VBScript + WMI within ASP

 

 
Powered by phpBB® Forum Software