Enable / Disable protocols in SQL Server using PowerShell

EnableProtocols.ps1 ########################################################################################### # Scenario: Enable / Disable protocols in SQL Server # ( Thanks Michiel http://blogs.msdn.com/mwories/ for helping me out) # #  How to use this powershell script: #    – Launch SQL Server PowerShell ( Start -> Run -> sqlps.exe) #    – Copy the following powershell script and paste it in powershell window ########################################################################################### #…

0

Configure Database Mirroring using SQL 2008 Power Shell

############################################################################################ Scenario: Configure Database mirroring##  How to use this powershell script:#    – Launch SQL Server PowerShell ( Start -> Run -> sqlps.exe)#    – Copy the following powershell script and save to file (Ex c:\DBMirrroringSetup.ps1)#    – in powershell window, type in script file path ( Ex: c:\DBMirrroringSetup.ps1) to run the script########################################################################################### # Backup Databasefunction BackupDatabase{        Param([string]$servername, [string]$dbName,…

4

SQL 2008 powershell script to print Resource Governor properties

############################################################################################ SQL 2008 powershell script to print Resource Governor state, properties, Resource pools and corresponding workload groups##  How to use this powershell script:#    – Launch SQL Server Management  Studio ( Start -> All Programs -> Microsoft SQL Server 2008 -> SQL Server Management Studio)#    – Connect to SQL Server instance, Right click on the server…

0

SQL 2008 Powershell Script for creating a Policy and saving to file

############################################################ SQL 2008 Powershell Script for Policy Based Management # Scenario: Create a  server policy to check if XPCmdShell is disabled and save it to file# # To run this Powershell script# 1) Install SQL Server 2008# 2) Run SQL PowerShell ( Start -> Run -> sqlps.exe)# 3) Copy the following script and paste it…

1

SQL Powershell – Unrestrict Growth size on all Database Files that has AutoGrowth set as None

############################################################################################ Scenario: Unrestrict Growth size on all Database Files that has AutoGrowth set as None# The following SQL 2008 Powershell sample code enumerates all  user database data files and sets Autogrowth by 10% ##  How to use this powershell script:#    – Launch SQL Server Management  Studio ( Start -> All Programs -> Microsoft SQL Server…

1

Create backups for databases that were not backed up during last 1 day

  a) Install SQL Server 2008. You can get RC0 from here: Download SQL 2008 RC0 b) Launch SQL Server Management  Studio ( Start -> All Programs -> Microsoft SQL Server 2008 -> SQL Server Management Studio) c) Connect to SQL Server instance, Right click on the server node in Object Explorer and click on…

0

SQL 2008 Power Shell script – Databases that were not backed up in last 7 days

a) Install SQL Server 2008. b) Launch SQL Server Management  Studio ( Start -> All Programs -> Microsoft SQL Server 2008 -> SQL Server Management Studio) c) Connect to SQL Server instance, Right click on the server node in Object Explorer and click on “Start Power Shell” menu d) Get the list of all databases…

0