Deploy Qualys Cloud Agent for Linux via Powershell
Execute the following commands in your Powershell command-line tool to install the Linux Cloud Agents.
Installation Command for Specific Resource Group of VMs
Use the following installation command in the Powershell command-line tool to install Qualys Cloud Agents on the resource group of VMs specified in the installation command.
Get-AzVM -ResourceGroupName <Resource_Group_Name> | ForEach-Object {az vm extension set -n QualysAgentLinux --publisher Qualys --version <1.6> --vm-name $.Name --resource-group $.ResourceGroupName --settings '
{"LicenseCode": "<Code>","PublicKey":"<Key>"}
' --debug}
To learn more about retrieving public key and license code, refer to Download Cloud Agent Installer.
The current version of Qualys Azure extension is 1.6. Use this same version in all the following commands.
Installation Command for All VMs
Use the following installation command in the Powershell command-line tool to install Qualys Cloud Agents on all the VMs without specifying any particular resource group.
Get-AzVM | ForEach-Object {az vm extension set -n QualysAgentLinux --publisher Qualys --version <1.6> --vm-name $.Name --resource-group $.ResourceGroupName --settings '
{"LicenseCode": "<Code>","PublicKey":"<Key>"}
' --debug}
Installation Command for Specific Resource Group of Linux VMs
Use the following installation command in the Powershell command-line tool to install Qualys Cloud Agents on resource group of Linux VMs specified in the installation command.
Get-AzVM -ResourceGroupName <ResourceGroupName> | ForEach-Object{if ($.StorageProfile.osDisk.osType -like "Linux"){az vm extension set -n QualysAgentLinux --publisher Qualys --version <1.6> --vm-name $.Name --resource-group $_.ResourceGroupName --settings '
{"LicenseCode": "<Code>","PublicKey":"<Key>"}
' --debug}}
Installation Command for All Linux VMs
Use the following installation command in the Powershell command-line tool to install Qualys Cloud Agents on all the Linux VMs without specifying any particular resource group.
Get-AzVM | ForEach-Object{if ($.StorageProfile.osDisk.osType -like "Linux"){az vm extension set -n QualysAgentLinux --publisher Qualys --version <1.6> --vm-name $.Name --resource-group $_.ResourceGroupName --settings '
{"LicenseCode": "<Code>","PublicKey":"<Key>"}
' --debug}}
The above installation commands are just samples for your reference. Enter the proper values for placeholders, depicted in angular brackets (<>), for successful installation.