-
Notifications
You must be signed in to change notification settings - Fork 0
Send SqlReport
external help file: Databaseline-help.xml Module Name: Databaseline online version: https://dbatools.io/ schema: 2.0.0
Execute a SQL statement and email the results.
Send-SqlReport [-Subject] <String> [-To] <String[]> [-Sql] <String> [-SqlInstance] <DbaInstanceParameter>
[-Database] <String> [-EmptySubject <String>] [-From <String>] [-Caption <String>] [-ReportFile <String>]
[-QueryTimeout <Int32>] [-PreContent <String>] [-PostContent <String>] [-Cc <String[]>] [-Bcc <String[]>]
[-Priority <MailPriority>] [-UseSsl] [-SeqUrl <Uri>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
[<CommonParameters>]
{{ Fill in the Description }}
PS C:\> {{ Add example code here }}{{ Add example description here }}
The email subject.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe email address(es) to send the results to.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe SQL statement to execute.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe server to use, by name or constructed via Connect-DbaInstance.
Type: DbaInstanceParameter
Parameter Sets: (All)
Aliases: Parent, ServerInstance
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe the database to connect to on the server.
Type: String
Parameter Sets: (All)
Aliases: Name
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe subject line for the email when no data is returned.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe from address to use for the email. The default is to use $PSEmailServer.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe optional table caption to add.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseA UNC path to a .csv or .tsv file writable by the script and readable by the email recipient to output the data to, which will be linked in the email rather than included in the email body.
Supports a format template for the current date and time (e.g. {0:yyyyMMddHHmmss}).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe timeout to use for the query, in seconds. The default is 90.
Type: Int32
Parameter Sets: (All)
Aliases: Timeout
Required: False
Position: Named
Default value: 90
Accept pipeline input: False
Accept wildcard characters: FalseHTML content to insert into the email before the query results.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseHTML content to insert into the email after the query results.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe email address(es) to CC the results to.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe email address(es) to BCC the results to.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe priority of the email, one of: High, Low, Normal
Type: MailPriority
Parameter Sets: (All)
Aliases:
Accepted values: Normal, Low, High
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIndicates that SSL should be used when sending the message.
(See the From parameter for an alternate SSL flag.)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe URL of the Seq server to log to.
Type: Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $PSDefaultParameterValues['Send-SeqEvent:Server']
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.