Share via

Query registries

Duchemin, Dominique 2,011 Reputation points
2022-06-25T02:56:56.88+00:00

Hello,

How could I get the following information in Configuration Manager?
![214936-2022-06-24-19-50-41-wuserver-registry.png][1]

I saw the WUServer and WUStatusServer but not the TargetGroup... is it available through query, report, inventory etc...

configuration.mof

//==================================================================
//
// Configuration.mof - WMI configuration that will be compiled on
// SMS clients.
//
// Copyright (c) Microsoft Corporation, All Rights Reserved
//
//==================================================================
//==================================================================
// Define registry classes for inventory reporting
//
// - Registry key/value class definition should be done in cimv2,
// - SMS class definition should be done in cimv2\sms
//==================================================================
//----------------------
// Add Remove Programs
//----------------------
#pragma namespace ("\\.\root\cimv2")
[ dynamic,
provider("RegProv"),
ClassContext("local|HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall")
]
class Win32Reg_AddRemovePrograms
{
[key]
string ProdID;
[PropertyContext("DisplayName")]
string DisplayName;
[PropertyContext("InstallDate")]
string InstallDate;
[PropertyContext("Publisher") ]
string Publisher;
[PropertyContext("DisplayVersion")]
string Version;
};
……………………………………………………………………………………………………….
//----------------------
// Windows Update
//----------------------
#pragma namespace ("\\.\root\cimv2")
#pragma deleteclass("Win32Reg_SMSWindowsUpdate", NOFAIL)
[DYNPROPS]
class Win32Reg_SMSWindowsUpdate
{
[key]string InstanceKey;
uint32 UseWUServer;
uint32 NoAutoUpdate;
uint32 AUOptions;
};
[DYNPROPS]
instance of Win32Reg_SMSWindowsUpdate
{
InstanceKey = "Windows Update";
[PropertyContext("local|HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU|UseWUServer"), Dynamic, Provider("RegPropProv")]
UseWUServer;
[PropertyContext("local|HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU|NoAutoUpdate"), Dynamic, Provider("RegPropProv")]
NoAutoUpdate;
[PropertyContext("local|HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU|AUOptions"), Dynamic, Provider("RegPropProv")]
AUOptions;
};
#pragma namespace ("\\.\root\cimv2")
……
#pragma namespace ("\\.\root\cimv2")
//========================
// Added extensions start
//========================
#pragma namespace ("\\.\root\cimv2")
#pragma namespace ("\\.\root\cimv2")
#pragma deleteclass("WSUSLocation", NOFAIL)
[DYNPROPS]
Class WSUSLocation
{
[key] string KeyName;
String WUServer;
String WUStatusServer;
};
[DYNPROPS]
Instance of WSUSLocation
{
KeyName="RegKeyToMOF_32";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate|WUServer"),Dynamic,Provider("RegPropProv")] WUServer;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate|WUStatusServer"),Dynamic,Provider("RegPropProv")] WUStatusServer;
};
#pragma namespace ("\\.\root\cimv2")
#pragma deleteclass("WSUSLocation_64", NOFAIL)
[DYNPROPS]
Class WSUSLocation_64
{
[key] string KeyName;
String WUServer;
String WUStatusServer;
};
[DYNPROPS]
Instance of WSUSLocation_64
{
KeyName="RegKeyToMOF_64";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate|WUServer"),Dynamic,Provider("RegPropProv")] WUServer;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate|WUStatusServer"),Dynamic,Provider("RegPropProv")] WUStatusServer;
};
//=======================================================
// Added extensions end
//========================

---------------------------------------------------------------------------------------------------------------------------------

Is standard and already collected?
is it a customization?

Thanks,
Dom
[1]: /api/attachments/214936-2022-06-24-19-50-41-wuserver-registry.png?platform=QnA

Microsoft Security | Intune | Configuration Manager | Other
0 comments No comments

Answer accepted by question author

AllenLiu-MSFT 49,441 Reputation points Microsoft External Staff
2022-06-27T02:43:06.21+00:00

Hi, @Duchemin, Dominique

Thank you for posting in Microsoft Q&A forum.

We can use CMPivot to query registry:

Registry('HKLM:\\SOFTWARE\\policies\\Microsoft\\windows\\windowsupdate') | where Property == 'TargetGroup'   

Here is an example that I query the value of WUServer:
215134-1.png


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Duchemin, Dominique 2,011 Reputation points
    2022-06-29T19:51:07.813+00:00

    The CMPivot works fine

    Thanks,
    Dom

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.