
Welcome to the course for PowerShell scripting for SQL DBA. In this course we are going to learn how to develop the PowerShell Script for Daily DBA Task for SQL Server and we are going to Automate the Script using PowerShell.
History and Version of PowerShell
PowerShell Vs CMD
Basic PowerShell Commands
cmdlet Vs Function
PowerShell ISE
Start writing PowerShell Programing1
Start writing PowerShell Programing2
Start and Stop all SQL services
7zip installation using PowerShell
Example: For-each Loop
How to connect with SQL servver and Run the script in Powershell
Get-Content and Set-content
PowerShell ExecutionPolicy
How to Send email from PowerShell
Pipe and format the result in PowerShell
Operator in PowerShell
If-IfElse-IfElseIf - Loop
ForEach and ForEach-Object Loop
For-DoWhile-DoUntill Loop in Powershell
Switch Loop
Template of Ps1
START OF PROGRAM - Start All sql server services
V1.Start the SQL Service for Named and Default Instance
V2 Programing Adding Log file
V3 Programing for Stopping services and Adding Log file
V4 Programing for Starting services and Adding Log file
V6 Programing - Function creation for log file in code
V7. If log file is not available it will not give any error
V8 Programing - Adding wrong server its throwging error
V9 Adding wrong host in and error got fixed
V10 Fixed the Named Instance issue
If Server is cluster - Script will not perform any activities
v12Display the result in colour for starting or filed
V13 How to make path as constant
V14 Programing - Constant Path Creating Log Folder.
V15 Programing - Adding Filestamp in logfile
V16 Adding Timestamp inside the log file
How to get Current Path
How to get all service pack Details using PowerShell
Connect SQL server using PowerShell and Pass the Parameter using config file
PowerShell with SQL Server
How to Import Module and automate using Powershell
How to connect SQL server using SMO with example
Connect SQL server using Cmdlt and run a SQL script
How to run multiple of script in single server
How to Zip and Unzip using powershell
SMO Object Model - With Example
How to change Server or Database configuration using SMO
Fixed the WMI error in PowerShell
Read Errorlog and Service Account using SMO
How to change service account and password using SMO
In this course you will get in depth knowledge of PowerShell after that you will be able to develop the script using PowerShell easily.
Basically, this course has been divided in to 20 sessions/Module which include the HTML Session, Evendu you will find the others additional session in this course, which will be the subcategory of the main course. For Sub-category you have to go through each Module.
I am going to provide and discussed total 100+ script, you can download and start doing the practice after each session.
I will be frequently uploading the video. For doubt clarification I will provide my email so that you can send me mail for any doubt.
This course has designed in such a way that anyone having the basic knowledge of DBA, they can easily learn and develop the script using PowerShell for SQL DBA at the end of this course.
In this session will cover that how to start writing the PowerShell script from basic to advance level. It will be going to include Daily DBA Task like - Backup, Restore, how to script the Database objects, creating and scheduling SQL Job in Single or Multiple servers. Running the script in multiple servers, BCP IN and BCP out, how to schedule the script using task scheduler or SQL Agent and many more things. How to pass the parameter using config file, creating own module ETC.
Standard way of writing the script.
1. Generating log file for any script.
2. Ping the server.
3. Passing multiple parameters using single configuration file.
4. Creating function in script
5. Displaying the result in color
6. Adding the time stamp in log file.
7. Setting the variable
8. Registry level of information
Monitoring / Generating Report
In this session we are going to work on SQL Server Monitoring Part and Generating and sending the alert/Notification using email in HTML body or as attachments. As per below screen shot
This report has been generated for Database file usage as HTML body.
We are going to learn that how to generate the Health check report and monitoring the many things.
a. Monitoring like Database data files and log file space.
b. Disk space monitoring for single of multiple of servers.
c. CPU or Ram usage monitoring.
d. Long running job, Blocking, Deadlock etc
e. Creating report for Backup status.
f. Job Failed status report.
g. Sending the alert/Notification if any services will be down.
· HTML
a. Basic of HTML
b. Static and Dynamic HTML Report
c. How customize the HTML report and adding some comment.
d. Sending email in the format of HTML body using PowerShell.
· Cloud (Going to be Uploaded very Soon)
a. Basic of Azure Cloud
b. How to develop the PowerShell scripts for AZURE cloud.