Category Archives: PowerShell

PowerSQL – SQL Inventory Generation – Email – High Level Details

Inventory allows anyone to quickly and easily assess any environment. For few servers, answering  Inventory questions might not be so difficult.  But if you’re managing ‘N’ number of SQL Server instances then its going to be tedious job and you’re … Continue reading

Posted in PowerShell, SQL | Tagged , | Leave a comment

PowerSQL – Identify a Head of the Database Blocks and Generate Automated Alert across all listed SQL Instances

This is going to be a simplest way of capturing and sending some useful information via an email of ‘N’ number of servers. With a little modification, you can implement various database related automation and capture very useful information. To Identify … Continue reading

Posted in PowerShell, SQL | Tagged , , | 1 Comment

PowerSQL – List SQL Server instance configuration details and sending an automated email

This article walks through how to list SQL Server configurable and non-configurable  instance settings using PowerShell and sending an automated email to a listed users. The  Function SendEmail has MailServerName as one of its parameter. Please change accordingly.The following code loads … Continue reading

Posted in PowerShell, SQL | Tagged , | 1 Comment

PowerSQL -Recycle SQL Instance (Remote or Local)

We have a scheduled maintenance window to recycle SQL SERVER Instance once in 30 days hence created a PowerShell job where function being placed along with parameters(servername and instancename) and executed it across all SQLinstance. (Named or Default instance) Default instance-> MSSQLSERVER  and … Continue reading

Posted in PowerShell, SQL | Tagged | Leave a comment

PowerSQL – Generate Only Index Script of All Tables or Specific Tables

Background of this implementation-As a part of Performance tuning, We noticed huge avg_disk_queue_length on F drive after analysis, we’ve recommended to move two tables(data and index)to different drive all together a different filegroup.  This would give the best IO performance. Those … Continue reading

Posted in PowerShell, SQL | Tagged | 2 Comments

PowerSQL – Database Backup Report across all Servers – Centralized Approach

This topic provides and describes the quickest way to find when and what databases are being backed up recently.Backups are most important part of a recovery strategy. In this case, I’m explaining this process in three steps 1) Instance names … Continue reading

Posted in PowerShell, SQL | 5 Comments

PowerShell – Get an UNC of a remote folder

To Read/Write/Rename/Copy/Delete a file configured across ‘N’ of servers in the same path, this script is going to be very handy. One example – Citrix Migration – IMA data store Input – ServerName and Input folder path. $server =”Server01“ $InputPath=”C:\Program … Continue reading

Posted in PowerShell | Leave a comment

PowerSQL – Find and Replace string on multiple file of local or remote machine

Copy and Paste the below content in Set-FindandReplaceString.PS1. Please read the instructions carefully. Try to do a dry run on some test folders for better results. ############################################################################# # Description : Find and Replace string on any local or remote machine # … Continue reading

Posted in PowerShell | Leave a comment

Power Shell or Windows – Rebooting of servers local or remote computers

Rebooting of servers local or remote Using PowerShell and Windows Powershell command Start->Run->Powershell press enter PS:\>RESTART-COMPUTER -COMPUTERNAME SERVER01, SERVER02,LOCALHOST Windows Command Start->Run->cmd press enter c:\>shutdown /m \\server01 /r /f /t 02 /m \\Server A remote computer to shutdown – server01 … Continue reading

Posted in PowerShell | Leave a comment

PowerShell – Find Disk Drive Details of local or remote Server

Name of the Function : Get-DiskDriveDetails Input Parameter : ServerName Ouptut : Grid view, you can sort and force condition on specific output column Function call : Get-DiskDriveDetails HQDB001 In this case HQDB001 is Name of the Server Code: Function Get-DiskDriveDetails([String]$server){Get-WMIObject Win32_LogicalDisk … Continue reading

Posted in PowerShell | Leave a comment