Monthly Archives: July 2013

SQL – Query to find data,log,Total Size and other Useful information of all databases – SQL 2000/2005/2008/R2

I’ve encountered a situation where I need to find out the database file,log file, total size and other useful information about a database on SQL Server 2000/2005/2008/R2 versions. The requirement is to use same query and it has to be … Continue reading

Posted in SQL, T-SQL | Tagged , , , | 10 Comments

PowerShell – Identify and switch between installed PowerShell Versions

Most of the time we have been used to cmdlets and it’s various features but do not know about the version and hence this post might help some of you to understand in finding different versions of PowerShell and how … Continue reading

Posted in PowerShell | Tagged , , , , | 3 Comments

PowerShell – Get CPU Details and its Usage

This PowerShell script helpful in finding No of Processors, Speed and It’s current usage based on samples being gathered at frequent intervals. /* Get No of Processors,Speed and its usage*/ Function Get-CPUs { param ($server) $processors = get-wmiobject -computername $server … Continue reading

Posted in PowerShell | Tagged , , , , | 2 Comments

PowerSQL – Find OS and Memory Usage Details – Multi Server Script – No Input files

Multi Server script to find OS and Memory details.  It doesn’t require a text file as its input but you have to pass computer names as its parameters which are separated by comma. function Get-OSMemory { param( [string[]]$ComputerName = “.” … Continue reading

Posted in PowerShell | Tagged , , , | 2 Comments

SQLCMD –Quick Copy of Files – Using Robocopy

The requirement is to move the files to different server programatically and hence I’ve decided to use Robocopy in SQLCMD. Robocopy is a command line utility. It has been available as part of the windows resource kit and It’s one of … Continue reading

Posted in Robocopy, SETVAR, SQLCMD, T-SQL | Tagged , , | 3 Comments

PowerSQL – SQL Instance Configuration & Installation Information by Reading Registry Keys

Today I got a chance to retrieve configuration information of sql server 2005 instances. PowerShell provide a facility to read the registry information with ease. PowerShell treats the registry like any other location or directory. One critical difference is that … Continue reading

Posted in PowerShell | Tagged , , | 1 Comment