Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » PowerShell

Create an Excel Graph of your Big Tables – with PowerShell!

I showed a demo of how to find the top ten tables in the database at the PASS Conference. Here’s that script – you’ll need to fix the server name, instance name, and database name. You can use this to display any numbers – and even more. The mind reels

Read a Web Page from PowerShell, Make a Web Page from a Database Query From PowerShell

I presented at the Pacific Northwest SQL Server User Group here in the Seattle area last night, and I was asked at the break about reading a web page in PowerShell, and being able to do something with the data it has. There are actually a few ways to
Posted by Buck Woody | 0 Comments
Filed under: , ,

PowerShell and SQL Server: Script all Tables

This is a script that I found/put together/re-arranged that will script out all of the tables from a database - in this case, Adventureworks2008. You need to change the BWOODY1 part to the name of your server, and the SQL2K8 part to your Instance name.
Posted by Buck Woody | 0 Comments

Use PowerShell to Backup All User Databases

This script will back up all user databases - you need to change the BWOODY1\SQL2K8 part to your server\instance name, and of course, you should only run this on a test system until you completely understand it. Unfortunately, the SQL Server PowerShell
Posted by Buck Woody | 4 Comments

Read the SQL Server Error Log with PowerShell

This script uses a native client call, so you can use it on any machine that has PowerShell installed along with the SQL Server client software. As always, only run this script on a test system until you understand what it does, and of course you'll need
Posted by Buck Woody | 3 Comments

Why Use PowerShell with SQL Server?

If you've never read the "scripting guys" at Microsoft, they are a hoot. Ed Wilson and Craig Liebendorfer do a fantastic job of writing each week and helping with scripting of all kinds, including PowerShell. Well, this week they appointed me
Posted by Buck Woody | 1 Comments

PowerShell to the clipboard

In PowerShell 2.0, there's a command to get things to the clipboard. I haven't deployed 2.0 yet, though, since I'm a DBA and naturally paranoid about anything beta on my systems. So I searched for other ways to do that, and there are a few, but then I
Posted by Buck Woody | 3 Comments
Filed under:

And the Winner is - Get SQL Server Error Messages from PowerShell

I spoke yesterday at a large user group meeting, and we had a prize offered for the best PowerShell script. One question that was asked is how to script out Replication Objects using PowerShell - but that question was answered here already, on our very
Posted by Buck Woody | 1 Comments
Filed under: ,

Run a SQL Server Command from PowerShell without the SQL Server Provider

Some folks don't have SQL Server 2008 installed - shame on you! If you're in that sad state, you can still run a query against a SQL Server. You will still need the client connection software installed on your system - you'll have that with any 2005 edition
Posted by Buck Woody | 1 Comments
Filed under: ,

Best Practices Policy Based Management from PowerShell

I'm working on my Policies (SQL Server 2008 Policy Based Management) for my environments that I manage. I use them to check the maintenance, show system state, and in some cases, to prevent actions from occurring when I don't want them to. I was asked

Using PowerShell and SMO to list Databases (and other stuff)

You don't have to use the new PowerShell Provider for SQL Server 2008 to talk to SQL Server, even for versions from 2000 up. To do that, you'll need the Server Management Objects (SMO) libraries. You can install those separately, but you'll already have

... and yet another way to find SQL Server Instances with PowerShell ...

I got another great comment today on the last two posts: Good article today on searching out SQL servers with PS. The combination of your and Ben's methods work best though. In Ben's example, you have to pull back all the Win32_Service objects and then

Finding SQL Servers with PowerShell, Part Deux

A reader named "Ben" wrote me and said that he looked at my script in PowerShell that finds SQL Server Instances using the WMI provider yesterday and he came up with another method. Here's what he wrote: Hi there, I wasn't able to find a way

Find those rogue SQL Servers in your Enterprise with PowerShell

I found a great way to check and see if a server has SQL Server installed on it. It uses “WMI”, or Windows Management Instrumentation and PowerShell. It simply interrogates the Services on a system to see if SQL Server is there, whether it

Logging in to another SQL Server from a PowerShell session

Whenever you run the command SQLPS.EXE on a SQL Server 2008 system, or right-click an object and select "Start PowerShell Here" from the menu, you're dropped into the environment on that server. But sometimes you want to connect to a different
Posted by Buck Woody | 1 Comments
More Posts Next page »
 
Page view tracker