Custom Inventory wildcard
Needing to find all machines in our environment that have a static IP address.
The information we need is contained here in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\{08E64730-E8A7-48A5-9912-88BAA0ABBDE3}
The problem is that the last bit of the registry entry is random letters and numbers. How can I program that into the custom inventory to look in the correct folder?
The actual value name is "IPAddress"
Thanks.
0 Comments
[ + ] Show comments
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
dugullett
11 years ago
Not sure about the wildcard, but something like this should work. You should then be able to turn this into a report.
ShellCommandTextReturn(powershell Get-WmiObject Win32_NetworkAdapterConfiguration -filter 'ipenabled= "true"'|Select Description, IPAddress, DHCPEnabled| Format-List)
Comments:
-
Good work sir. Thanks. - AFCUjstrick 11 years ago
-
To clean the report up some you may want to just search for machines with DHCP not enabled.
ShellCommandTextReturn(powershell Get-WmiObject Win32_NetworkAdapterConfiguration -filter 'ipenabled= "true"'|where {$_.dhcpenabled -like 'False'}|Select Description, IPAddress, DHCPEnabled| Format-List) - dugullett 11 years ago
-
Powershell is definitely handy to have in the toolbox. - AFCUjstrick 11 years ago
-
Also note: Anything you can "Get-WmiObject" in PowerShell, you can probably query in a batch file using WMIC. Of course, in a batch file, the parsing of the results is more difficult. - snissen 11 years ago
-
You could also report on MACHINE_NICS.DHCP_ENABLED. - grayematter 11 years ago
-
Good idea! - AFCUjstrick 11 years ago