Querying servers for Service Patches???

  • Thread starter Thread starter Mike Lambert
  • Start date Start date
M

Mike Lambert

Can anyone tell me, or at least give me some direction, on how/if one would
be able to query multiple Win2k servers to see if they had certain service
packs(ie. KB828026) or recommend updates (ieQ322001) installed?

Thanks,
Mike
 
This information is stored in the registry. Your program will need to connect to the registry of each of your servers in turn and query values from the required values and keys. For the service pack, query the string held in "HKLM\Software\Microsoft\Windows NT\CurrentVersion\CSDVersion". For the installed updates, enumerate the keys under "HKLM\Software\Microsoft\Windows NT\CurrentVersion\HotFix"

If you don't already know how to access the registry using the .NET Framework then take a look at the 'Registry' class under the 'Microsoft.Win32' namespace which contains all the registry access functions you will need

Gar
 
Thanks Gary!!!!

Gary Milton said:
This information is stored in the registry. Your program will need to
connect to the registry of each of your servers in turn and query values
from the required values and keys. For the service pack, query the string
held in "HKLM\Software\Microsoft\Windows NT\CurrentVersion\CSDVersion". For
the installed updates, enumerate the keys under
"HKLM\Software\Microsoft\Windows NT\CurrentVersion\HotFix".
If you don't already know how to access the registry using the .NET
Framework then take a look at the 'Registry' class under the
'Microsoft.Win32' namespace which contains all the registry access functions
you will need.
 
What would be the most efficient way to connect to another computers
registry????

Thanks


Gary Milton said:
This information is stored in the registry. Your program will need to
connect to the registry of each of your servers in turn and query values
from the required values and keys. For the service pack, query the string
held in "HKLM\Software\Microsoft\Windows NT\CurrentVersion\CSDVersion". For
the installed updates, enumerate the keys under
"HKLM\Software\Microsoft\Windows NT\CurrentVersion\HotFix".
If you don't already know how to access the registry using the .NET
Framework then take a look at the 'Registry' class under the
'Microsoft.Win32' namespace which contains all the registry access functions
you will need.
 
Include "Imports Microsoft.Win32" at the top of your form/module and then to get the service pack, do the following..

Dim objRegistryKey As RegistryKe
Dim objRegistrySubKey As RegistryKe

objRegistryKey = Registry.LocalMachine.OpenRemoteBaseKey(RegistryHive.LocalMachine, "MILTONG-MOBILE"

If Not IsNothing(objRegistryKey) The
objRegistrySubKey = objRegistryKey.OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion1"

If Not IsNothing(objRegistrySubKey) The
MsgBox(objRegistrySubKey.GetValue("CSDVersion", "")

objRegistrySubKey.Close(
End I

objRegistryKey.Close(
End I

Simple!!

Gary
 
I should probably have also mentioned to you that the user running your application will need to have the necessary security privileges to query those registry keys on the remote server. If it is always going to be run by a domain admin then you probably don't need to wory too much, otherwise you will need to put some error handling around the code to stop the user getting an runtime error if they do not have the required permissions

Gary
 
Back
Top