Deploy Cloud Agent via Powershell

Execute the following commands in your Powershell command-line tool to install the 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 resource group of VMs specified in the installation command.

Get-AzVM -ResourceGroupName <Resource_Group_Name> | ForEach-Object {az vm extension set -n QualysAgent --publisher Qualys --version <1.6> --vm-name $.Name --resource-group $.ResourceGroupName --settings '

{"LicenseCode": "<Code>","PublicKey":"<Key>"}
' --debug}

The current version of Qualys Azure extention 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 perticular resource group.

Get-AzVM | ForEach-Object {az vm extension set -n QualysAgent --publisher Qualys --version <1.6> --vm-name $.Name --resource-group $.ResourceGroupName --settings '

{"LicenseCode": "<Code>","PublicKey":"<Key>"}
' --debug}

Installation Command for Specific Resource Group of Windows VMs

Use the following installation command in the Powershell command-line tool to install Qualys Cloud Agents on resource group of Windows VMs specified in the installation command.

Get-AzVM -ResourceGroupName <ResourceGroupName> | ForEach-Object{if ($.StorageProfile.osDisk.osType -like "Windows"){az vm extension set -n QualysAgent --publisher Qualys --version <1.6> --vm-name $.Name  --resource-group $_.ResourceGroupName --settings '

{"LicenseCode": "<Code>","PublicKey":"<Key>"}
' --debug}}

Installation Command for All Windows VMs

Use the following installation command in the Powershell command-line tool to install Qualys Cloud Agents on all the Windows VMs without specifying any particular resource group.

Get-AzVM | ForEach-Object{if ($.StorageProfile.osDisk.osType -like "Windows"){az vm extension set -n QualysAgent --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.