Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Me, myself and Powershell


Me, myself and Powershell

Author
Message
ALZDBA
ALZDBA
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6972 Visits: 8839
hemanth.damecharla (12/7/2011)
Automating daily tasks is not only easy with Posh but, fun as well :-)

Chad Miller's MSCS code on poshcode site is a wonderful starting point if you want to get a hang of WMI. I would like to thank Chad for posting this particular piece of code http://poshcode.org/2886.

I tried it as challenge to get all the data in one shot (Cluster, Groups, Resources and resource types), it was an awesome feeling when I was able to do it. After that, you can build a hash with the data; add some methods and vallah, you don't have to look at cluster admin console again ;-)

PowerShell is aptly named.


I can't stress the FUN part enough.
There is indeed a whole bunch of practical info and great samples out there.
Chad is one of the people posting on a regular basis and knowing his stuff.
Thank you for the feedback.

Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution" :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
pkrudysz
pkrudysz
Valued Member
Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)

Group: General Forum Members
Points: 52 Visits: 267
Oftentimes folks applaud PowerShell for things, and I see that those things can be done and automated just as easily in t-sql. I am looking for a list of PowerShell stuff that CANNOT be done in SQL, and that a DBA can find handy. One example I can think of is accessing non-SQL performance counters. Anything else useful for a DBA?
ALZDBA
ALZDBA
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6972 Visits: 8839
e.g.
- setting startup parameters if your service account doesn't have local sysadmin at windows level.
- granting auth at windows level ( e.g. to push backup files to a safe zone )
- are you using SMO to configure sqlserver things ?

you name it, you got it.

Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution" :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
pkrudysz
pkrudysz
Valued Member
Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)

Group: General Forum Members
Points: 52 Visits: 267
ALZDBA (12/29/2011)

- setting startup parameters if your service account doesn't have local sysadmin at windows level.

- Cool.

ALZDBA (12/29/2011)

- granting auth at windows level ( e.g. to push backup files to a safe zone )

- xp_cmdshell

ALZDBA (12/29/2011)
- are you using SMO to configure sqlserver things ?

- No, no need. I use sqlserver (SSMS/T-SQL) to configure sqlserver things
ALZDBA
ALZDBA
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6972 Visits: 8839
pkrudysz (12/29/2011)
ALZDBA (12/29/2011)

- setting startup parameters if your service account doesn't have local sysadmin at windows level.

- Cool.

ALZDBA (12/29/2011)

- granting auth at windows level ( e.g. to push backup files to a safe zone )

- xp_cmdshell

ALZDBA (12/29/2011)
- are you using SMO to configure sqlserver things ?

- No, no need. I use sqlserver (SSMS/T-SQL) to configure sqlserver things


Of course you can do it all manually, time and again.

You are correct, xp_cmdshell can take you a long way.

Powershell only provides the means to hook up to more than just what's available in DOS (xp_cmdshell) and vbscript.
That means for many systems people, that don't program e.g. c#.net, .. they have to learn only one language syntax, hook up to their target namespace and use that software's proper methodes to configure whatever needed.

Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution" :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
ALZDBA
ALZDBA
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6972 Visits: 8839
Please allow me to point to a very interesting project at codeplex:

Scripted PowerShell Automated Deployment Engine (SPADE) for SQL Server

pre-configure windows, install sql, post install scripts, ....

Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution" :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search