StumpedTechy
MIS
I have to develop a script that does a few things.
1) I need to verify if a registry key exists and if it has the proper permissions.
2) If the permissions arent there I have to add them. This is a local group on the machine.
3) I have to check WMI and see if its working.
4) If not I have to reinstall WMI.
Here are the manaul steps I do.
run regedit
go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg and check the permissons for Local Service if its not there I add and give it full control.
I then go open WMI explorer and see if I can acess the local machine wmi.
If not then I run - rundll32.exe setupapi,InstallHinfSection WBEM 132 %windir%\inf\wbemoc.inf
when I run this I then get a prompt for a path to Windows files and then I have to type in the server share - \\Server\Share\WMIRepair\i386
Now I know how to do a regread and I think the run command should be simple to do with a wshell.run command.
What I don't know about is the following -
1) checking permissions and adding permissions with VBScript.
2) Also what is a simple way to see if WMI is working? The only thing I can think of is a WMI query and look for results?
The reason I know WMI is not working right is when I use WMI explorer and I click on any Win32 object it shows absolutely no data in the instances field. I did this with OperatingSystem and other major ones with no results shown.
3) Is there any way to do an install with rundll32 where I can put the path of the install files? Right now it defaults to the install directory of the OS but the media is not in that place and is on a share so I have to change it on each install.
1) I need to verify if a registry key exists and if it has the proper permissions.
2) If the permissions arent there I have to add them. This is a local group on the machine.
3) I have to check WMI and see if its working.
4) If not I have to reinstall WMI.
Here are the manaul steps I do.
run regedit
go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg and check the permissons for Local Service if its not there I add and give it full control.
I then go open WMI explorer and see if I can acess the local machine wmi.
If not then I run - rundll32.exe setupapi,InstallHinfSection WBEM 132 %windir%\inf\wbemoc.inf
when I run this I then get a prompt for a path to Windows files and then I have to type in the server share - \\Server\Share\WMIRepair\i386
Now I know how to do a regread and I think the run command should be simple to do with a wshell.run command.
What I don't know about is the following -
1) checking permissions and adding permissions with VBScript.
2) Also what is a simple way to see if WMI is working? The only thing I can think of is a WMI query and look for results?
The reason I know WMI is not working right is when I use WMI explorer and I click on any Win32 object it shows absolutely no data in the instances field. I did this with OperatingSystem and other major ones with no results shown.
3) Is there any way to do an install with rundll32 where I can put the path of the install files? Right now it defaults to the install directory of the OS but the media is not in that place and is on a share so I have to change it on each install.