Syntax
Get-Compliance [-Server <VIServer[]>] [-Entity] <InventoryItem> [-ComplianceStatus <ComplianceStatus>] [-Baseline <Baseline[]>] [-Detailed] [<CommonParameters>]Related Commands
Online versionDetailed Description
This cmdlet retrieves baseline compliance data for the specified object of type Template, VirtualMachine, VMHost, Cluster, Datacenter, Folder, and VApp. The cmdlet returns information about the compliance of the specified entity with the baselines that are attached to it. If the entity is a container, the cmdlet returns compliance data for all objects in the container.Parameters
Return Type
VMware.VumAutomation.Types.BaselineComplianceNotes
Examples
-------------- Example 1 --------------
Get-Compliance -Entity VM
Retrieves a list of all baselines attached to the VM virtual machine and shows their compliance status and the number of the Compliant, NotCompliant, Unknown and NotApplicable patches.
-------------- Example 2 --------------
Get-Compliance -Entity $datacenter
Retrieves a list of all baselines attached to the datacenters in $datacenter and shows their compliance status and the number of the Compliant, NotCompliant and Unknown patches.
-------------- Example 3 --------------
Get-VM -Name VM | Get-Compliance
Retrieves a list of all baselines attached to the VM virtual machine and shows their compliance status and the number of the Compliant, NotCompliant, Unknown and NotApplicable patches.
-------------- Example 4 --------------
Get-DataCenter DataCenter | Get-VM "VM*" | Get-Compliance
Retrieves the compliance status for all virtual machines in the Datacenter datacenter whose names start with "VM".
-------------- Example 5 --------------
$statuses = Get-Compliance -Entity VM -ComplianceStatus Unknown if (([array]($statuses)).Count -gt 0) {Scan-Inventory -Entity VM}
Retrieves the compliance status of the baselines attached to the VM virtual machine. If there is at least one baseline with Unknown compliance status, a scan is started.