Deploy Cloud Agent For Windows 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.

For Specific Resource Group of VMs

 
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}

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 perticular resource group.

For All VMs

 
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.

For Specific Resource Group of Windows VMs

 
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.

For all Windows VMs

 
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.

Proxy Configuration without Authentication

Use the following command in Azure Cloudshell to configure the proxy without authentication.

Without Authentication

 
az vm extension set -resource-group <RESOURCE_GROUP_NAME> vm-name <VM_NAME> name QualysAgent publisher Qualys -version 1.6  --protected-settings '{"ProxySettings": {"Servers": [
{"Type": "NoAuth", "Url": "http://ProxyServerIP:Port"}
]}}' --no-wait  --debug
  

Proxy Configuration with Authentication

Use the following command in Azure Cloudshell to configure the proxy with authentication.

With Authentication

 
az vm extension set -resource-group <RESOURCE_GROUP_NAME> vm-name <VM_NAME> name QualysAgent publisher Qualys -version 1.6  --protected-settings '{"ProxySettings": {"Servers": [
{"Type": "RegularAuth", "Url": "http://username:password@ProxyServerIP:Port"}
]}}' --no-wait  --debug