Moduły/Skrypty, PowerShell, SQL Server

SQLServerJobsModule – PowerShell

SQLServerJobsModule allows you to generate a report about SQL Server Jobs from several servers. Allows you to specify a time window for the report. Allows you get details about connections in packages IS.

Minimum Requirements

Server
  • SQL Server 2008
  • PowerShell 4.0 with remoting enabled needed on the host for Windows commands
Workstation
  • Windows 7 with PowerShell v4
  • SQL Server 2008 R2 SMO or SSMS

SQLServerJobsModule is not required on the server.

I recommend to use the script at client stations, but I encourage to make a test at servers.

Install

1. Install from the PowerShell Gallery

Install-Module -Name SQLServerJobsModule

The PowerShell Gallery and the command Install-Module are natively available in Windows 10. If you run Windows 7 or 8 or 8.1, you can either install PackageManagement from powershellgallery.com

2. Download the zip directly and manually import the module.

Using module

SQLServerJobsModule allows you to generate a report about SQL Server Jobs from several servers. Allows you to specify a time window for the report. Allows you get details about connections in packages IS.

Get-SQLServerJobs – allows get all Jobs on SQL Server.

Get-SQLServerJobs -InstanceServer IT-MN-M\MSSQLSERVER14

SQLServerJobsModule allows you to generate a report about SQL Server Jobs from several servers. Allows you to specify a time window for the report. Allows you get details about connections in packages IS.

„IT-MN-M\MSSQLSERVER14” | Get-SQLServerJobs | Select JobName,NextRun

SQLServerJobsModule

Show-SQLServerUpdatesReport  – returns information about SQL Server Jobs in the format html.

Show-SQLServerJobsReport -InstanceServer IT-MN-M\MSSQLSERVER14 -Path C:\temp

Report about all SQL Server Jobs.  Report saved in path C:\temp.

SQLServerJobsModule

Show-SQLServerJobsReport -InstanceServer IT-MN-M\MSSQLSERVER14 -Path C:\temp\ -StartTime -EndTime

Allows get all Jobs on server which it will starts at a specific time and it will ends at a specific time. Report saved in path C:\temp.

SQLServerJobsModule

Show-SQLServerUpdatesReport -ServerInstance it-mn-m\mssqlserver14, test-agsqlserver -HTML -Path C:\temp\report.html

Additional information.

Used T-SQL query :

Errors and problems

Please send me information about errors and problems  by email.