Category Archives: Powershell

Most common challenges and solution with Availability group listener and multisubnetfailover

Industry started using SQL availability groups on most of their environments, DBA is coming across multiple issues related to AGListener connectivity. This blog explains 2 major challenges and solutions in detail: https://blogs.msdn.microsoft.com/alwaysonpro/2014/06/03/connection-timeouts-in-multi-subnet-availability-group/ I recommend option-1 to enable client to use … Continue reading

Posted in Learn_Powershell, SQL, SQL Server, Uncategorized | Tagged , , , , , | Leave a comment

Azure Scripting errors after upgrading Powershell to V4 – Select-AzureRmProfile / Save-AzureRmProfile

After upgrading Powershell to V4, few of my scripts started failing. Few updated commandlets are missing backward compatibility, Select-AzureRmProfile/ Save-AzureRmProfile are couple of the broken commandlets. You can replace them with Import-AzureRmContext, and Save-AzureRmContext. Code block I use for reference: … Continue reading

Posted in Azure, Powershell, SQL Server, Uncategorized | Tagged , , , , , | Leave a comment

Powershell commands – my quick reference

Posted in Learn_Powershell, Powershell, Productivity, Uncategorized | Tagged | Leave a comment

Windows Server storage capacity and usage report using Powershell

Below Scrip generates list of all Drives and mount points configured, thery storage capacity and free space. Following Script to check the storage on a single server; If you want to calculate the storage to be added to maintain certain … Continue reading

Posted in Powershell, Productivity, Uncategorized, Windows Server | Tagged , , , , | Leave a comment

Generate SQL Query for Database Snapshot creation using Powershell

Following PowerShell script generates SQL Query to take a snapshot;

Posted in Powershell, Productivity, SQL, Uncategorized | Tagged , , , , | Leave a comment

Powershell script to test Geo-Replication Configuration

Recently we have upgraded and downgraded multiple databases in SQLAzure and as part of that we have deleted and recreated geo-replication on large number of databases. Considering the number of databases and priority we end up performing manual changes. Created … Continue reading

Posted in Azure, Powershell, SQL, Uncategorized | Tagged , , , , | Leave a comment

Check if the Server is pending reboot

I have used this Powershell script to validate if the server is pending a reboot or not. This script can be used to validate server pending reboot status on any other server within the network! https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542

Posted in Powershell, Windows Server | Tagged , , | Leave a comment