Get-SMServerBpaResult

Get-SMServerBpaResult

Gets the results of BPA scans.

Syntax

Parameter Set: GetServerBpaResult3
Get-SMServerBpaResult -BpaXPath <String[]> [-BatchSize <UInt32> ] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>] [ <WorkflowParameters>]




Detailed Description

The Get-SMServerBpaResult cmdlet retrieves raw XML results of Best Practices Analyzer (BPA) scans on server roles, role services, or features, for one or more specified XPaths. To get BPA scan results, we recommend that you run the Get-BpaResult cmdlet instead of this cmdlet.

Parameters

-BatchSize<UInt32>

Specifies the batch size, or number of result entries, that you want displayed in command results.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BpaXPath<String[]>

Specifies one or more BPA XPaths where BPA scan results are available. Specify the BPA XPath in the the following format: BpaModelId:BpaFilepath:BpaXPath.

To get the names for BPA models that are installed on the target server, run the cmdlet Get-BpaModel. There is no file path available for results for a BPA model on a server until at least one set of scan results is available; that is, at least one scan has been run on the role or feature that is represented by the model. For best results, and to avoid errors, enclose the value of this parameter in single quotation marks. The following is a sample BpaXPath parameter value for results from a BPA scan on Hyper-V.

'Microsoft/Windows/Hyper-V:$reports$\*\Result.xml:/$ResultDatabase$/$Result$'


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-CimSession<CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.


Aliases

Session

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

<WorkflowParameters>

This cmdlet supports the following workflow common parameters: -PSParameterCollection, -PSComputerName, -PSCredential, -PSConnectionRetryCount, -PSConnectionRetryIntervalSec, -PSRunningTimeoutSec, -PSElapsedTimeoutSec, -PSPersist, -PSAuthentication, -PSAuthenticationLevel, -PSApplicationName, -PSPort, -PSUseSSL, -PSConfigurationName, -PSConnectionURI, -PSAllowRedirection, -PSSessionOption, -PSCertificateThumbprint, -PSPrivateMetadata, -AsJob, -JobName, and –InputObject. For more information, see    about_WorkflowCommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Get BPA scan results, as raw XML, for a scan on Hyper-V

This command gets the raw XML results of a BPA scan that was run on the Hyper-V role. Before you can run this command, run a BPA scan on the role, or verify that there are existing BPA scan results. For a better view of the command results, pipe the command to the Format-List cmdlet, another Format-* cmdlet, or to a file by using Out-File.


PS C:\> Get-SmServerBpaResult -BpaXPath 'Microsoft/Windows/Hyper-V:$reports$\*\Result.xml:/$ResultDatabase$/$Result$' | Format-List

Example 2: Get BPA scan results for File Services, and pipe them to a text file

This command gets the raw XML results of a BPA scan that was run on the File Services role, and pipes those results to a plain text file.


PS C:\> Get-SmServerBpaResult -BpaXPath 'Microsoft/Windows/FileServices:$reports$\*\Result.xml:/$ResultDatabase$/$Result$' | Format-List | Out-File -FilePath C:\Users\SashaD\Desktop\FSResults.txt

Community Additions

ADD
Show: