none
Using WMI to remotely query registry Windows 2000 servers is not working RRS feed

  • Question

  • I am having this problem when I try to use WMI to connect to the registry of a remote Windows 2000 server:

    PS C:\> Get-WMIObject -list "StdRegProv" -Namespace root\default -Computer "Win2KServerName"
    Get-WMIObject : Invalid query
    At line:1 char:1
    + Get-WMIObject -list "StdRegProv" -Namespace root\default -Computer "Win2KServerName"
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], ManagementException
        + FullyQualifiedErrorId : System.Management.ManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

    My understanding is that StdRegProv is supported on Windows 2000 - but I have not confirmed that.  Also, if I run this command it does show StdRegProv listed:

    Get-WMIObject -list -Namespace root\default -Computer "Win2KServerName"

    Here is an excerpt of the returned data:

    __ConsumerFailureEvent              {}                   {ErrorCode, ErrorDescription, Event, IntendedConsumer}
    __SystemSecurity                    {GetSD, Get9XUser... {}
    __ADAPStatus                        {}                   {LastStartTime, LastStopTime, Status}
    RegistryEvent                       {}                   {}
    RegistryKeyChangeEvent              {}                   {Hive, KeyPath}
    RegistryTreeChangeEvent             {}                   {Hive, RootPath}
    RegistryValueChangeEvent            {}                   {Hive, KeyPath, ValueName}
    StdRegProv                          {CreateKey, Delet... {}

    Any ideas?

    Thanks

    NK

    Tuesday, January 13, 2015 8:51 PM

Answers

  • Thanks.

    Also looks like I can use Win32_OperatingSystem and query "servicepackmajorversion".  One of those "Oh duh!" moments on my part considering how simple that was!

    NK

    • Marked as answer by NJK-Work Tuesday, January 13, 2015 9:25 PM
    Tuesday, January 13, 2015 9:24 PM

All replies

  • IIRC, StdRegProv existed in Windows 2000, but that OS has not been supported for a number of years.

    What's provoking the question (what are you trying to do)?


    -- Bill Stewart [Bill_Stewart]

    Tuesday, January 13, 2015 8:54 PM
    Moderator
  • I have scripts that query 700+ servers for various pieces of information including Service Pack information.  I have standardized on WMI since I collect other things such as memory, server model, etc.  Since WMI has the ability read the registry, it makes my scripts simpler because I can use WMI for everything.  So I remotely read the registry, using WMI, to collect Service Pack information.

    But maybe there is another native WMI query that I am overlooking that will get me SP information without have to pull it from the registry.

    NK


    • Edited by NJK-Work Tuesday, January 13, 2015 9:07 PM
    Tuesday, January 13, 2015 9:06 PM
  • The service pack should be available from the computer object in AD (operatingSystemServicePack attribute).

    -- Bill Stewart [Bill_Stewart]

    Tuesday, January 13, 2015 9:16 PM
    Moderator
  • Thanks.

    Also looks like I can use Win32_OperatingSystem and query "servicepackmajorversion".  One of those "Oh duh!" moments on my part considering how simple that was!

    NK

    • Marked as answer by NJK-Work Tuesday, January 13, 2015 9:25 PM
    Tuesday, January 13, 2015 9:24 PM
  • My preference is to pull the information from AD if it's available, because this is always faster than connecting to the WMI service on a computer.

    -- Bill Stewart [Bill_Stewart]

    Tuesday, January 13, 2015 10:54 PM
    Moderator