Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Powershell and Administration Expand / Collapse
Author
Message
Posted Monday, April 6, 2009 4:22 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Saturday, August 4, 2012 1:25 PM
Points: 514, Visits: 151
At PASS Summit 08, I was introduced to Powershell, and I was pretty excited about using it to track information about some of the SQL servers at my company. I'm aspiring to become a DBA, but I'm a developer at the moment. I was wondering if there were other DBA's out there or general administrators who use Powershell to monitor and track information about their servers. If so, what information are you tracking? Is powershell a good administrative tool to be using or should I focus on something else?

I'm currently tracking disk space, SQL job errors, SQL log file sizes, SQL data file sizes, last SQL backup dates, system errors, and application errors.

Thanks for your time and input
Post #691538
Posted Monday, April 6, 2009 4:48 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 5:38 PM
Points: 31,355, Visits: 15,819
Powershell is being built into Windows and Exchange as the admin language for systems from Microsoft. I bet that you'd find tons of people using it in other areas with Windows systems. I'd run a Google search for monitoring servers with Powershell.






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #691553
Posted Monday, April 6, 2009 7:03 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:08 AM
Points: 14,200, Visits: 28,527
We've started using PowerShell more and more, but not so much for monitoring since we use Operations Manager for that. We've mainly been using it as a means for cleaning up backups & log files. I've also created a script that simply verifies connectivity on all our servers. As soon as I learn how to spawn threads (can you?) I'll create a massive DBCC check to run against all our servers after a power down event (we get one a year and they're a royal pain in the back side).

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #691600
Posted Monday, April 6, 2009 10:01 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Friday, December 12, 2014 12:03 PM
Points: 4,363, Visits: 9,547
Grant Fritchey (4/6/2009)
We've started using PowerShell more and more, but not so much for monitoring since we use Operations Manager for that. We've mainly been using it as a means for cleaning up backups & log files. I've also created a script that simply verifies connectivity on all our servers. As soon as I learn how to spawn threads (can you?) I'll create a massive DBCC check to run against all our servers after a power down event (we get one a year and they're a royal pain in the back side).


Not in v1 (AFAIK) - but, I hear that v2 not only has remoting capabilities but also the ability to create multiple threads (jobs).

I use powershell scripts to get information loaded into a central repository to track data space usage, last backup, version info, etc...


Jeffrey Williams
Problems are opportunites brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs
Post #691649
Posted Tuesday, April 7, 2009 5:22 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:08 AM
Points: 14,200, Visits: 28,527
Jeffrey Williams (4/6/2009)

Not in v1 (AFAIK) - but, I hear that v2 not only has remoting capabilities but also the ability to create multiple threads (jobs).

I use powershell scripts to get information loaded into a central repository to track data space usage, last backup, version info, etc...


Ah, that stinks. Well, then I'll still be running a whole bunch of TSQL windows in SSMS like usual. It works well enough. It's just a pain in the bottom to set up.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #691852
Posted Tuesday, April 7, 2009 8:24 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Saturday, August 4, 2012 1:25 PM
Points: 514, Visits: 151
I'll have to check out Operations Manager. It appears there is a lot you can do with Powershell, and I wasn't sure what other people on this site were using it for.

Thanks for your replies.
Post #692064
Posted Wednesday, April 15, 2009 2:41 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, December 4, 2014 2:39 PM
Points: 202, Visits: 1,108
Some of the things that I have been using it for on some of our lower level servers (that we do not have licenses for commercial monitoring tools) are to:

verify SQL Agents are Running
verify SQL connectivity
Ping Servers
Send messages on failures of these things
storing all of this sort of data within SQL for reporting later

These things can be useful if you can not afford Idera DM or Quest Spotlight for your servers, since it can give you most of that same inforamation.

As mentioned above we also use it for space tracking on all of our servers (SQL and Non-SQL). WMI is great for that sort of thing.

I have also found Powershell useful if you are the kind of person automated copying/deleting/maintenance of files. It gives a very easy interface for that sort of thing, and once you create the script you can just keep calling the same script with different arguments, which makes it very flexible.

I am always looking for other ideas to use PS for so I would love to see if anyone else has thoughts.
Post #697928
Posted Wednesday, May 20, 2009 8:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 16, 2012 8:04 AM
Points: 3, Visits: 507
I've used it to help create a script to delete old backups that SQL Server wasn't getting rid of and also to create an at a glance report to tell me what agent jobs have failed, what errors are in the sql log, and disk space available quickly. I don't have the luxury of admin tools at a lot of my clients so I've started creating some things on my own that are useful.
Post #720619
Posted Thursday, May 21, 2009 2:09 PM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Monday, December 15, 2014 1:42 PM
Points: 644, Visits: 2,151
I am actually excited at the possibilities of automating a lot of my work with Powershell. I enjoy scripts (having had fun with shell scripts and Perl in the past), and if I could integrate them in a way that saves a lot of time for me, I'm all for it.

Gaby
________________________________________________________________
"In theory, theory and practice are the same. In practice, they are not."
- Albert Einstein
Post #721681
Posted Friday, May 22, 2009 10:56 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, December 2, 2014 8:16 AM
Points: 1,618, Visits: 1,554
I've started using PowerShell only recently myself. Personally, I was really disappointed when they replaced SQL-DMO with SMO/AMO/RMO because they are not scripted interfaces. For me, the reason I love powershell is that it has turned SMO into a scripted interface again.

I've posted some powershell scripts on my blog, most of which came out of my powershell script for database mirroring. I wrote a powershell script that performs the entire setup of database mirroring from the script. The real power of it is that I can run the script from my laptop to set up mirroring on remote servers that do not have powershell installed.

That script won't be on my blog though. You'll have to buy my book to get that one.




My blog: SQL Soldier
Twitter: @SQLSoldier
My book: Pro SQL Server 2008 Mirroring
Microsoft Certified Master: SQL Server 2008
Principal DBA: Outerwall, Inc.
Also available for consulting: SQL DBA Master
Post #722234
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse