Start-SCComplianceScan

Starts a compliance scan of a managed computer or host cluster.

Description

The Start-SCComplianceScan cmdlet starts a compliance scan of a managed computer or host cluster. During a compliance scan, the specified managed computer or host cluster is compared against assigned baselines, and the resulting compliance state is returned.

For more information about Start-SCComplianceScan, type: "Get-Help Start-SCComplianceScan -online".

Parameters

VMHostCluster

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM host cluster object.

Baseline

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM baseline object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

VMMManagedComputer

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a computer object that is managed by VMM.

Baseline

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM baseline object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Examples

1: Scan a host against a given baseline.
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01"
PS C:\> $Compliance = Get-SCComplianceStatus -VMMManagedComputer $VMHost.ManagedComputer
PS C:\> foreach($bsc in $Compliance.BaselineLevelComplianceStatus)`
PS C:\> {if ($bsc.Baseline.Name -eq "Security Baseline")`
PS C:\> {$Baseline = $bsc.Baseline; break}}
PS C:\> Start-SCComplianceScan -VMMManagedComputer $VMHost.ManagedComputer -Baseline $Baseline

The first command gets the host object named VMHost01 and stores the object in the $VMHost variable.

The second command gets the compliance status object for the host stored in $VMHost01 and stores the object in the $Compliance variable.

The next three lines use a foreach statement to loop through the baseline compliance status objects for the host. If the baseline named Security Baseline is found, then the fifth command stores it in the $Baseline variable.

The last command starts the compliance scan on the host, using the baseline stored in $Baseline, which in this example is Security Baseline.

See Also