Query Windows
cnquery provides the answers you need about your Windows assets. For example, you can retrieve the Windows version, user information, or security settings.
For a list of Windows resources you can query, read Mondoo Operating Systems (OS) Resource Pack Reference and Mondoo Core Resource Pack Reference.
Requirements
To explore a Windows asset with cnquery, you must have:
- cnquery installed on your workstation
- Access to the asset
Query a Windows asset
To answer any question about your environment, use cnquery's interactive shell. It has auto-complete to guide you, which is especially helpful when you're new to cnquery and learning MQL.
To launch a shell into your local Windows environment, enter:
cnquery shell
To launch a shell into a remote Windows environment, enter:
cnquery shell ssh Administrator@IP_ADDRESS --ask-pass
For IP_ADDRESS
, substitute the IP address of the remote Windows asset.
If you prefer WinRM for remote access, enter:
cnquery shell winrm Administrator@IP_ADDRESS --ask-pass
For IP_ADDRESS
, substitute the IP address of the remote Windows asset.
Discover capabilities with the help
command
Once inside the shell, use the help
command to learn what Windows resources you can query. This command lists all the operating system resources:
help os
From the resulting list, you can drill down further. For example, enter this command to list the OS update information you can retrieve:
help os.update
You can also learn about available Windows resources in the Mondoo Operating Systems (OS) Resource Pack Reference and Mondoo Core Resource Pack Reference.