Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Programming
»
Powershell
»
Powershell and Administration
13 posts, Page 1 of 2
1
2
»»
Powershell and Administration
Rate Topic
Display Mode
Topic Options
Author
Message
Sankey
Sankey
Posted Monday, April 06, 2009 4:22 PM
Mr or Mrs. 500
Group: General Forum Members
Last Login: Saturday, August 04, 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
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Monday, April 06, 2009 4:48 PM
SSC-Dedicated
Group: Administrators
Last Login: Yesterday @ 1:47 PM
Points: 31,406,
Visits: 13,722
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
Grant Fritchey
Grant Fritchey
Posted Monday, April 06, 2009 7:03 PM
SSChampion
Group: General Forum Members
Last Login: Today @ 4:50 AM
Points: 13,371,
Visits: 25,143
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #691600
Jeffrey Williams 3188
Jeffrey Williams 3188
Posted Monday, April 06, 2009 10:01 PM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Yesterday @ 11:21 AM
Points: 4,317,
Visits: 9,216
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
Grant Fritchey
Grant Fritchey
Posted Tuesday, April 07, 2009 5:22 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 4:50 AM
Points: 13,371,
Visits: 25,143
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #691852
Sankey
Sankey
Posted Tuesday, April 07, 2009 8:24 AM
Mr or Mrs. 500
Group: General Forum Members
Last Login: Saturday, August 04, 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
Mike - CI
Mike - CI
Posted Wednesday, April 15, 2009 2:41 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Friday, May 10, 2013 2:07 PM
Points: 197,
Visits: 1,028
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
Hope Foley-443128
Hope Foley-443128
Posted Wednesday, May 20, 2009 8:45 AM
Forum 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
GabyYYZ
GabyYYZ
Posted Thursday, May 21, 2009 2:09 PM
Right there with Babe
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 11:54 AM
Points: 795,
Visits: 1,981
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
Robert Davis
Robert Davis
Posted Friday, May 22, 2009 10:56 AM
SSCommitted
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 7:57 PM
Points: 1,558,
Visits: 1,395
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
Microsoft Certified Master: SQL Server 2008
Sr. Product Consultant and Chief SQL Server Evangelist @ Idera
My book: Pro SQL Server 2008 Mirroring
Post #722234
« Prev Topic
|
Next Topic »
13 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.