Trying to pull a list of remote applications using WMIC and "Name like '%wildcard%'"

  • 8 months ago
Comment

ChatGPT
1 / 1

If you're trying to use the WMIC command in Windows to pull a list of remote applications with a specific name wildcard using the Name property, you can do it as follows:

batch
WMIC /NODE:"RemoteComputerName" /NAMESPACE:"\\root\cimv2" /USER:"Username" /PASSWORD:"Password" /OUTPUT:"OutputFilePath.txt" /FORMAT:CSV
PATH Win32_Product WHERE "Name LIKE '%%Wildcard%%'"

Replace the placeholders:

  • "RemoteComputerName": Replace this with the actual name of the remote computer from which you want to retrieve the list of applications.
  • "Username": Replace this with the username with necessary privileges to access the remote computer.
  • "Password": Replace this with the password for the specified username.
  • "OutputFilePath.txt": Replace this with the desired output file path where you want to save the list.
  • "Wildcard": Replace this with the desired wildcard pattern to match the application names.

Note that using WMIC to query remote computers requires administrative privileges on both the local and remote machines.

Keep in mind that the Win32_Product class can be slow and can cause issues, particularly on large networks, as it triggers a repair operation on every application it queries. Additionally, it's recommended to use more modern tools like PowerShell to achieve similar tasks, as it offers more control and flexibility.