< Back

Install-DbsAudit

Mon Jan 13, 2020 9:06 am

NAME Install-DbsAudit



SYNOPSIS

Installs the supplemental SQL Server Audit provided by DISA





SYNTAX

Install-DbsAudit [-SqlInstance] <DbaInstanceParameter[]> [-SqlCredential <PSCredential>] [-Name <String>] [-Path

<String>] [-MaxSize <String>] [-MaxFiles <String>] [-Reserve <String>] [-QueueDelay <String>] [-OnFailure

<String>] [-EnableException] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION





PARAMETERS

-SqlInstance <DbaInstanceParameter[]>

The target SQL Server instance or instances. Server version must be SQL Server version 2012 or higher.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-SqlCredential <PSCredential>

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).



Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory -

Integrated are all supported.



For MFA support, please use Connect-DbaInstance.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <String>

The name of the audit and audit specification. Defaults to DISA's default of DISA_STIG.



Required? false

Position? named

Default value DISA_STIG

Accept pipeline input? false

Accept wildcard characters? false



-Path <String>

The path where the audit files will be created. Defaults to default data directory + STIG. Creates the

directory if it does not exist.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-MaxSize <String>

The max size of each audit file. Defaults to 10MB.



Required? false

Position? named

Default value 10 MB

Accept pipeline input? false

Accept wildcard characters? false



-MaxFiles <String>

The max number of files to keep. Defaults to 50.



Required? false

Position? named

Default value 50

Accept pipeline input? false

Accept wildcard characters? false



-Reserve <String>

Sets the reserve of disk space. Defaults to OFF.



Required? false

Position? named

Default value OFF

Accept pipeline input? false

Accept wildcard characters? false



-QueueDelay <String>

Sets the queue delay of the audit. Defaults to 1000.



Required? false

Position? named

Default value 1000

Accept pipeline input? false

Accept wildcard characters? false



-OnFailure <String>

Instructs SQL Server of what to do on failure. Defaults to SHUTDOWN. Options include 'FAIL_OPERATION',

'SHUTDOWN', 'CONTINUE'.



Required? false

Position? named

Default value SHUTDOWN

Accept pipeline input? false

Accept wildcard characters? false



-EnableException [<SwitchParameter>]

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.

This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables

advanced scripting.

Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own

try/catch.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

If this switch is enabled, no actions are performed but informational messages will be displayed that explain

what would happen if the command were to run.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

If this switch is enabled, you will be prompted for confirmation before executing any operations that change

state.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: DISA, STIG

Author: Chrissy LeMaire (@cl), netnerds.net



Copyright: (c) 2010 by Chrissy LeMaire, licensed under MIT

License: MIT https://opensource.org/licenses/MITl



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Install-DbsAudit -SqlInstance sql2017, sql2016, sql2012



Detect version and create appropriate audit from DISA, output to DATA\\Stig\\, shutdown on failure









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Install-DbsAudit -SqlInstance sql2017 -SqlCredential sqladmin -Path C:\\temp -OnFaiure Continue



Login as sqladmin, detect version and create appropriate audit from DISA, output to C:\\temp, continue on failure









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-DbaRegServer -SqlInstance sqlcentral | Install-DbaDisaStigAudit



Installs sp_WhoisActive to all servers within CMS











RELATED LINKS