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


Day Zero with PowerShell


Day Zero with PowerShell

Author
Message
Aaron Nelson
Aaron Nelson
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 164
Comments posted to this topic are about the item Day Zero with PowerShell

@SQLvariantI have a PowerShell script for you.
Thomas Williams
Thomas Williams
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 155
Should there be a space in the "Set-ExecutionPolicy RemoteSigned" command?
colin.frame
colin.frame
SSC Veteran
SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)

Group: General Forum Members
Points: 236 Visits: 320
Thomas - yes. Also "ft -a" instead of "ft-a" in the example script.

Other than that, finally got me going with PowerShell - thanks Aaron!

--Colin Frame
Aaron Nelson
Aaron Nelson
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 164
Yes, there whould definitely be a space.

Sorry, the editor isn't properly rendering the code that I posted.

@SQLvariantI have a PowerShell script for you.
Alleged DBA
Alleged DBA
SSC Journeyman
SSC Journeyman (79 reputation)SSC Journeyman (79 reputation)SSC Journeyman (79 reputation)SSC Journeyman (79 reputation)SSC Journeyman (79 reputation)SSC Journeyman (79 reputation)SSC Journeyman (79 reputation)SSC Journeyman (79 reputation)

Group: General Forum Members
Points: 79 Visits: 368
This is great...just great...

One of the excuses obstacles for not getting started with PowerShell has been just getting things set up to be able to actually use the thing. This seemed to be a secret passed among an elite priesthood in dark misty passage ways. Not a place for mere mortals to tread.

Now, along comes Aaron Nelson and puts everything in a single, easy to digest article.
You've totally blown my excuse to not use PowerShell! Sheesh.

Ok, seriously. Nice article, Aaron. It is very nice to have the requirements assembled in one place.

Thank you!



Steve Jones
Steve Jones
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: Administrators
Points: 36145 Visits: 18748
Added spaces into the code. Should look fine now.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Aaron Nelson
Aaron Nelson
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 164
DJ (5/10/2011)
Nice article, Aaron. It is very nice to have the requirements assembled in one place.

Thank you!


Thanks DJ, glad you liked it. There should be more 'good reasons' to use PowerShell coming out very soon ;-)

@SQLvariantI have a PowerShell script for you.
Eric Stimpson
Eric Stimpson
Valued Member
Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)

Group: General Forum Members
Points: 61 Visits: 115
Thanks DJ. Can you maybe explain the purpose of the Set-ExecutionPolicy command? Also, when I tried the sample code, I got an error when trying to restart a server which I manually stopped:

Start-Service : Service 'SQL Server Agent (SQL2008) (SQLAgent$SQL2008)' cannot be started due to the following error: Cannot open SQLAgent$SQL2
008 service on computer '.'.
At line:6 char:14
+ Start-Service <<<<
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand
SQLRNNR
SQLRNNR
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21075 Visits: 18259
Thanks much for all of these tips.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

Aaron Nelson
Aaron Nelson
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 164
For running the example script you will probably need to elevate your shell (I keep forgetting that I have a pre-emptive work-around in place for this). Just hold down the Ctrl + Shift Keys and then click on the shortcut for the ISE. Then run the script in that window.

I'll work on getting a Summary for the Execution Policies however your best/most complete answer is in the Help files. June does a good job with those.

@SQLvariantI have a PowerShell script for you.
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