File tree 2 files changed +46
-0
lines changed
2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 12
12
. EXAMPLE
13
13
Get-DBADatabaseSize -Instance SERVER -Top 3
14
14
15
+ Returns the database names and sizes in Mb ordered by size for the 3 largest databases on SERVER
16
+ . EXAMPLE
17
+ Get-DBADatabaseSize SERVER 3
18
+
15
19
Returns the database names and sizes in Mb ordered by size for the 3 largest databases on SERVER
16
20
. OUTPUTS
17
21
Database object
Original file line number Diff line number Diff line change
1
+ function Get-DBAErrorLogPath
2
+ {
3
+ <#
4
+ . Synopsis
5
+ Returns the Error Log PAths for a SQL Server
6
+ . DESCRIPTION
7
+ returns the SQL or Agent Error log paths for a SQL Server
8
+ . EXAMPLE
9
+ Get-DBAErrorLogPath -Instance SERVER
10
+
11
+ Returns the Error Log Path for a SQL Server
12
+ . EXAMPLE
13
+ Get-DBADatabaseSize -Instance SERVER -Agent
14
+
15
+ Returns the SQL and Agent Log Error Paths for the SERVER
16
+ . EXAMPLE
17
+ Get-DBADatabaseSize SERVER
18
+
19
+ Returns the Error Log Path for a SQL Server
20
+ . OUTPUTS
21
+ String
22
+ . NOTES
23
+ AUTHOR - Rob Sewell https://sqldbawithabeard.com
24
+ DATE - 11/11/2016
25
+ #>
26
+ # Requires -Version 5
27
+ [OutputType ([string ])]
28
+ param (
29
+ # # The Name of the instance
30
+ [Parameter (Position = 0 , Mandatory = $true )]
31
+ [string ]$Instance ,
32
+ # # Display the AgentLog path as well
33
+ [switch ]$Agent
34
+ )
35
+ [void ][reflection.assembly ]::LoadWithPartialName( " Microsoft.SqlServer.Smo" );
36
+ $srv = New-Object - TypeName Microsoft.SqlServer.Management.Smo.Server - ArgumentList $Instance
37
+ Write-Output " Error Log Path - $ ( $srv.ErrorLogPath ) "
38
+ if ($Agent )
39
+ {
40
+ Write-Output " Agent Error Log Path - $ ( $srv.JobServer.ErrorLogFile ) "
41
+ }
42
+ }
You can’t perform that action at this time.
0 commit comments