Search the Community
Showing results for tags 'mof'.
-
Collecting Registry Info within Inventory
AndyR posted a question in Troubleshooting, Tools, Hints and Tips
Hello, I'm try to retrieve information from the registry on client workstations. I have read a few guides and sucessfully used RegKeyToMOFv3_R2 for a previous task however this time around I would like to report on data within HKey_Current_User. By default the RegKeyToMOFv3_R2 application targets HKEY_LOCAL_MACHINE. Does anyone know if the output can simply be edited to the HKCU location? Many thanks, Andy -
Hey Guys / Niall - I recently wrote and compiled a script which when executed on a workstation, will write a few registry strings to a custom key within the registry. The goal of this script is to inventory this data using SCCM. I think the issue I'm having is that by design, the script writes these values into a key which is named after the currently logged in user therefore is dynamic per system. I've tried using RegKeytoMOF and have looked at many pages like this one for how to add classes to inventory by editing MOF files, but haven't had luck. When using RegKeytoMOF and selecting the key named after the username, the MOF files it creates seem to populate correctly as I can clearly see each string within defined. I cannot use this as the key would be different per system so would assume I need to select the parent key. However, when I select the parent key of "ProfileInfo", the generated MOF files do not contain any settings nor mention "ProfileInfo." So - how do I go about doing this? Is the below correct? Thank you! Example of What I'm Trying to Inventory All Strings within: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Company\ProfileInfo\gwashington DocumentsSize = 100 DesktopSize = 50 MyProfile = 800 FavoritesSize = 0 AllProfilesSize = 1200 "HKLM\SOFTWARE\Wow6432Node\Company\ProfileInfo" would be the same on all PCs, but the key "gwashington" shown above is named after the logged in user so would be dynamic / different per system. All strings would be named the same within the user's key, but would obviously have different values per PC. RegKeytoMOF Output When "gwashington" Key Selected ClassGroup & ClassName set to "ProfileInfo" // RegKeyToMOF by Mark Cochrane (tribute to Skissinger & Steverac) // this section tells the inventory agent what to collect #pragma namespace ("\\\\.\\root\\cimv2") #pragma deleteclass("ProfileInfo", NOFAIL) [DYNPROPS] Class ProfileInfo { [key] string KeyName; String MyDocuments; String Desktop; String Favorites; String AppData; String MyProfile; String AllProfiles; String MyNetworkShare; }; [DYNPROPS] Instance of ProfileInfo { keyname="RegKeyToMOF[MarkCochrane]"; [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Company\\ProfileInfo\\gwashington|MyDocuments"),Dynamic,Provider("RegPropProv")] MyDocuments; [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Company\\ProfileInfo\\gwashington|Desktop"),Dynamic,Provider("RegPropProv")] Desktop; [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Company\\ProfileInfo\\gwashington|Favorites"),Dynamic,Provider("RegPropProv")] Favorites; [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Company\\ProfileInfo\\gwashington|AppData"),Dynamic,Provider("RegPropProv")] AppData; [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Company\\ProfileInfo\\gwashington|MyProfile"),Dynamic,Provider("RegPropProv")] MyProfile; [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Company\\ProfileInfo\\gwashington|AllProfiles"),Dynamic,Provider("RegPropProv")] AllProfiles; [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Company\\ProfileInfo\\gwashington|MyNetworkShare"),Dynamic,Provider("RegPropProv")] MyNetworkShare; }; RegKeytoMOF Output When "ProfileInfo" (Parent) Key Selected ClassGroup & ClassName set to "ProfileInfo" // RegKeyToMOF by Mark Cochrane (tribute to Skissinger & Steverac) // this section tells the inventory agent what to collect #pragma namespace ("\\\\.\\root\\cimv2") #pragma deleteclass("ProfileInfo", NOFAIL) [DYNPROPS] Class ProfileInfo { [key] string KeyName; }; [DYNPROPS] Instance of ProfileInfo { keyname="RegKeyToMOF[MarkCochrane]"; }; Thanks!
-
Hello, I'm fairly new to modifying the MOF file in SCCM to extend the hardware inventory. I've used it once to collect specific key/string values using RegKeyToMof in the past. I'm looking to collect the string names and values for an unknown set of strings in a specific location in the registry and I'm uncertain on how to do so. My specific use case is to collect HKLM\Software\Microsoft\Windows\CurrentVersion\Run and HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce. These keys control what software is loaded at start-up and could have any number of string names and values. I've looked for solutions online without any success, any help would be much appreciated. Thanks, Jones