SQL Clone
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
Mr or Mrs. 500
Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)

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

@SQLvariantI have a PowerShell script for you.
Thomas Williams
Thomas Williams
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 155
Should there be a space in the "Set-ExecutionPolicy RemoteSigned" command?
Colin Frame
Colin Frame
SSC-Addicted
SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)

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

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

Forum Etiquette: How to post data/code on a forum to get the best help
Make sure that you include code in the appropriate IFCode tags, e.g. [code=sql]<your code here>[/code]. You can find the IFCode tags under the INSERT options when you are writing a post.
Aaron Nelson
Aaron Nelson
Mr or Mrs. 500
Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)

Group: General Forum Members
Points: 562 Visits: 174
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 Veteran
SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)

Group: General Forum Members
Points: 223 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 Guru
SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)

Group: Administrators
Points: 146655 Visits: 19432
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
Mr or Mrs. 500
Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)

Group: General Forum Members
Points: 562 Visits: 174
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
SSC Veteran
SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)

Group: General Forum Members
Points: 225 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 Guru
SSC Guru (66K reputation)SSC Guru (66K reputation)SSC Guru (66K reputation)SSC Guru (66K reputation)SSC Guru (66K reputation)SSC Guru (66K reputation)SSC Guru (66K reputation)SSC Guru (66K reputation)

Group: General Forum Members
Points: 66709 Visits: 18570
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
Mr or Mrs. 500
Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)Mr or Mrs. 500 (562 reputation)

Group: General Forum Members
Points: 562 Visits: 174
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