Posted in Admin

PowerShell For DBA Part-8 (Write PowerShell output in email body or send as attachment)

Watch Part-1, Part-2, Part-3, Part-4, Part-5, Part-6, Part-7 Send the output as email body Get-Credential “YourEmail@gmail.com”|Export-Clixml D:\PowerShell\Cred.txt $credential=Import-Clixml D:\PowerShell\Cred.txt $Header = @” <style> TABLE {border-width: 1px; border-style: solid; border-color: black;…

Continue Reading... PowerShell For DBA Part-8 (Write PowerShell output in email body or send as attachment)
Posted in Admin

PowerShell For DBA Part-7 (Agent job monitoring and formatting HTML)

Watch Part-1, Part-2, Part-3, Part-4, Part-5, Part-6   Scripts Get-DbaAgentJob -SQLinstance localhost,localhost\SQL2017|Select * Get-DbaAgentJob -SQLinstance localhost,localhost\SQL2017|Select Computername,Name,CurrentRunStatus,LastRunOutcome | ConvertTo-Html | Out-File -FilePath D:\PowerShell\AgentJob.html Invoke-Expression D:\PowerShell\AgentJob.html Get-DbaAgentJob -SQLinstance localhost,localhost\SQL2017|Where-Object {$_.LastRunOutcome -eq…

Continue Reading... PowerShell For DBA Part-7 (Agent job monitoring and formatting HTML)
Posted in Admin

PowerShell For DBA Part-6 (HTML Conversion and Monitoring)

Watch Part-1, Part-2, Part-3, Part-4, Part-5 Follow me: Blog: http://Sqldepository.com YouTube : Sql depository Facebook: https://www.facebook.com/sqldepository/ Google+ :https://plus.google.com/u/0/107093915534620159617

Continue Reading... PowerShell For DBA Part-6 (HTML Conversion and Monitoring)
Posted in Admin

PowerShell FOR DBA Part-4 (Monitor Disk Space and send Alerts)

Watch Part-1, Part-2, Part-3     Scripts Get-DbaDiskSpace -ComputerName Sauras-Lenovo Get-DbaDiskSpace -ComputerName Sauras-Lenovo|Where-Object {$_.Free/1gb -lt 120}|Select * Get-DbaDiskSpace -ComputerName Sauras-Lenovo|Where-Object {$_.Free/1gb -lt 120}|Select *|Format-Table Get-DbaDiskSpace -ComputerName Sauras-Lenovo|Where-Object {$_.Free/1gb…

Continue Reading... PowerShell FOR DBA Part-4 (Monitor Disk Space and send Alerts)
Posted in Admin

Scripts-PowerShell For DBA Part-3

Database Backup On Source Server (Copy Only) Get-DbaDatabase -sqlinstance Localhost -ExcludeAllSystemdb|Backup-DbaDatabase -BackupDirectory C:\Backup\Migration -CreateFolder –Type Full -Copy Only Restore Database Backup On Destination Server restore-dbadatabase…

Continue Reading... Scripts-PowerShell For DBA Part-3
Posted in Admin

PowerShell For DBA Part-3(DB Migration)

It is recommended to watch Part-1 and Part-2 first. You can find Part-1 and Part-2 here   Follow me: Blog: http://Sqldepository.com YouTube : Sql depository Facebook: https://www.facebook.com/sqldepository/ Google+ :https://plus.google.com/u/0/107093915534620159617

Continue Reading... PowerShell For DBA Part-3(DB Migration)
Posted in Admin

PowerShell For DBA Part-2

It is recommended to watch part-1 first. If you haven’t watch the part-1 yet then you can watch it Here Scripts  PowerShell FOR DBA-Session-1-AND-2 Follow me:…

Continue Reading... PowerShell For DBA Part-2
Posted in Admin

PowerShell FOR DBA Part-1

  You can watch part-2 Here Follow me: Blog: http://Sqldepository.com YouTube : Sql depository Facebook: https://www.facebook.com/sqldepository/ Google+ :https://plus.google.com/u/0/107093915534620159617 Notice: JavaScript is required for this content.

Continue Reading... PowerShell FOR DBA Part-1