-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from rebelinux/SQLServer-Support
Sql server support
- Loading branch information
Showing
12 changed files
with
650 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
function Get-AbrWinSQLBackupDevice { | ||
<# | ||
.SYNOPSIS | ||
Used by As Built Report to retrieve Windows SQL Server backup device information. | ||
.DESCRIPTION | ||
Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo. | ||
.NOTES | ||
Version: 0.5.3 | ||
Author: Jonathan Colon | ||
Twitter: @rebelinux | ||
Github: AsBuiltReport | ||
Credits: Iain Brighton (@iainbrighton) - PScribo module | ||
.LINK | ||
https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
) | ||
|
||
begin { | ||
Write-PScriboMessage "SQL Server Backup Device InfoLevel set at $($InfoLevel.SQLServer)." | ||
} | ||
|
||
process { | ||
try { | ||
Write-PScriboMessage "Collecting SQL Server Backup Device information." | ||
$SQLBackUpDevices = Get-DbaBackupDevice -SqlInstance $SQLServer | Sort-Object -Property Name | ||
if ($SQLBackUpDevices) { | ||
Write-PScriboMessage "Collecting SQL Server Backup Device information." | ||
Section -Style Heading4 'Backup Device' { | ||
$ItemInfo = @() | ||
foreach ($Item in $SQLBackUpDevices) { | ||
try { | ||
$InObj = [Ordered]@{ | ||
'Name' = $Item.Name | ||
'Backup Device Type' = $Item.BackupDeviceType | ||
'Physical Location' = $Item.PhysicalLocation | ||
'Skip Tape Label' = ConvertTo-TextYN $Item.SkipTapeLabel | ||
} | ||
$ItemInfo += [PSCustomObject]$InObj | ||
} catch { | ||
Write-PScriboMessage -IsWarning "SQL Server System Backup Device Section: $($_.Exception.Message)" | ||
} | ||
} | ||
|
||
if ($InfoLevel.SQLServer -ge 2) { | ||
Paragraph "The following sections detail the configuration of the backup device $($SQLServer.Name)." | ||
foreach ($Item in $ItemInfo) { | ||
Section -Style NOTOCHeading5 -ExcludeFromTOC "$($Item.Name)" { | ||
$TableParams = @{ | ||
Name = "Backup Device - $($Item.Name)" | ||
List = $true | ||
ColumnWidths = 50, 50 | ||
} | ||
if ($Report.ShowTableCaptions) { | ||
$TableParams['Caption'] = "- $($TableParams.Name)" | ||
} | ||
$Item | Table @TableParams | ||
} | ||
} | ||
} else { | ||
Paragraph "The following table summarises the configuration of the backup device within $($SQLServer.Name)." | ||
BlankLine | ||
$TableParams = @{ | ||
Name = "Backup Devices" | ||
List = $false | ||
Columns = 'Name', 'Backup Device Type', 'Physical Location' | ||
ColumnWidths = 25, 25, 50 | ||
} | ||
if ($Report.ShowTableCaptions) { | ||
$TableParams['Caption'] = "- $($TableParams.Name)" | ||
} | ||
$ItemInfo | Table @TableParams | ||
} | ||
} | ||
} | ||
} catch { | ||
Write-PScriboMessage -IsWarning "SQL Server Backup Device Section: $($_.Exception.Message)" | ||
} | ||
} | ||
end {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
function Get-AbrWinSQLBuild { | ||
<# | ||
.SYNOPSIS | ||
Used by As Built Report to retrieve Windows SQL Server Properties information. | ||
.DESCRIPTION | ||
Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo. | ||
.NOTES | ||
Version: 0.5.2 | ||
Author: Andrew Ramsay | ||
Editor: Jonathan Colon | ||
Twitter: @asbuiltreport | ||
Github: AsBuiltReport | ||
Credits: Iain Brighton (@iainbrighton) - PScribo module | ||
.LINK | ||
https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
) | ||
|
||
begin { | ||
Write-PScriboMessage "SQL Server InfoLevel set at $($InfoLevel.SQLServer)." | ||
Write-PScriboMessage "Collecting SQL Server Properties information." | ||
} | ||
|
||
process { | ||
if ($InfoLevel.SQLServer -ge 1) { | ||
try { | ||
$Properties = Get-DbaInstanceProperty -SqlInstance $SQLServer | ForEach-Object { @{$_.Name = $_.Value } } | ||
$Build = Get-DbaBuild -SqlInstance $SQLServer | ||
if ($Properties) { | ||
Section -Style Heading3 'General Information' { | ||
Paragraph 'The following table details sql server Properties information' | ||
BlankLine | ||
[array]$SQLServerObjt = @() | ||
$TempSQLServerObjt = [PSCustomObject]@{ | ||
'Instance Name' = $Build.SqlInstance | ||
'Fully Qualified Net Name' = $Properties.FullyQualifiedNetName | ||
'Supported Until' = $Build.SupportedUntil.ToShortDateString() | ||
'Edition' = $Properties.Edition | ||
'Level' = "Microsoft SQL Server $($Build.NameLevel)" | ||
'Build' = $Properties.VersionString | ||
'Service Pack' = $Properties.ProductLevel | ||
'Comulative Update' = ConvertTo-EmptyToFiller $Build.CULevel | ||
'KB Level' = $Build.KBLevel | ||
'Case Sensitive' = ConvertTo-TextYN $Properties.IsCaseSensitive | ||
'Full Text Installed' = ConvertTo-TextYN $Properties.IsFullTextInstalled | ||
'XTP Supported' = ConvertTo-TextYN $Properties.IsXTPSupported | ||
'Clustered' = ConvertTo-TextYN $Properties.IsClustered | ||
'Single User' = ConvertTo-TextYN $Properties.IsSingleUser | ||
'Language' = $Properties.Language | ||
'Collation' = $Properties.Collation | ||
'Sql CharSet Name' = $Properties.SqlCharSetName | ||
'Root Directory' = $Properties.RootDirectory | ||
'Master DB Path' = $Properties.MasterDBPath | ||
'Master DB Log Path' = $Properties.MasterDBLogPath | ||
'Backup Directory' = $Properties.BackupDirectory | ||
'Default File' = $Properties.DefaultFile | ||
'Default Log' = $Properties.DefaultLog | ||
'Login Mode' = $Properties.LoginMode | ||
'Mail Profile' = ConvertTo-EmptyToFiller $Properties.MailProfile | ||
'Warning' = ConvertTo-EmptyToFiller $Build.Warning | ||
} | ||
$SQLServerObjt += $TempSQLServerObjt | ||
|
||
$TableParams = @{ | ||
Name = "General Information" | ||
List = $True | ||
ColumnWidths = 40, 60 | ||
} | ||
if ($Report.ShowTableCaptions) { | ||
$TableParams['Caption'] = "- $($TableParams.Name)" | ||
} | ||
$SQLServerObjt | Table @TableParams | ||
} | ||
} | ||
} catch { | ||
Write-PScriboMessage -IsWarning $_.Exception.Message | ||
} | ||
} | ||
} | ||
end {} | ||
} |
Oops, something went wrong.