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 (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 164
Steve Jones - SSC Editor (5/10/2011)
Added spaces into the code. Should look fine now.


Mucho Mejor! Gracias Senior Jones.

@SQLvariantI have a PowerShell script for you.
SQLSandwiches
SQLSandwiches
Old Hand
Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)

Group: General Forum Members
Points: 343 Visits: 1292
Good stuff! Wish I had found this article a year ago. I struggled getting started before. I hope this helps people just getting their feet wet.
JakDBA
JakDBA
Valued Member
Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)

Group: General Forum Members
Points: 63 Visits: 400
Simply Great Work and i started learning Power Shell Atlast with your help. Looking forward for more classes.

@JayMunnangi
shawnjohnson
shawnjohnson
Mr or Mrs. 500
Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)

Group: General Forum Members
Points: 570 Visits: 828
Great article! I've been working at learning PowerShell for a little while now and look forward to future articles.

I can manually stop the agent on my test server myself and when I run the script it will tell me that it is stopped but the script won't start it. I get this error:

Start-Service : Cannot find any service with service name 'SQLSERVERAGENT'.
At line:12 char:14
+ Start-Service <<<<
+ CategoryInfo : ObjectNotFound: (SQLSERVERAGENT:String) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.StartServiceCommand

What am I missing?
steve.treloar
steve.treloar
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 72
Great article Aaron!

Now that I have it installed and functional. (I've been procrastinating for a long time) I would really like to see more on what people are using PowerShell for on a daily basis. How can PowerShell make my life easier? I am not a DBA. I and another guy, manage about 100 MickySoft servers, six of them are SQL, for which we have a couple DBA's to do most of the data manipulation and application programming for. I have a SharePoint farm implemented, but the DBA's don't do much of anything there. I'm looking forward to more articles on PowerShell relative to SQL.

Thanks.

-Steve
Aaron Nelson
Aaron Nelson
SSC-Enthusiastic
SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 164
steve.treloar (5/24/2011)
Great article Aaron!


Thanks Steve!
I did another article the following day on how to calculate data file space usage using PowerShell http://www.sqlservercentral.com/articles/powershell/73289/

I have quite a few blog posts about useful PowerShell+SQL scripts here: http://sqlpowershell.com/

@SQLvariantI have a PowerShell script for you.
ifiok.moses
ifiok.moses
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 23
Thanks for a nice post. Can't wait for subsequent posts.
BTW i got this error message:

PS C:\Windows\system32> import-module SQLProfiler
Attention. This module only runs on x86 Powershell. Execution interrupted


Any ideas?
Aaron Nelson
Aaron Nelson
SSC-Enthusiastic
SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 164
Yes. I think you just need to open up the x86 version of the ISE and you'll be fine.

@SQLvariantI have a PowerShell script for you.
M&M
M&M
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2595 Visits: 3898
Aaron,

I should have read this article the first time it was published. This is one cool thing you have written on Powershell and has got me interested in this subject. I need to make sure not to delay learning about Powershell.

Thank you.

M&M
Doctor Who 2
Doctor Who 2
SSC Veteran
SSC Veteran (287 reputation)SSC Veteran (287 reputation)SSC Veteran (287 reputation)SSC Veteran (287 reputation)SSC Veteran (287 reputation)SSC Veteran (287 reputation)SSC Veteran (287 reputation)SSC Veteran (287 reputation)

Group: General Forum Members
Points: 287 Visits: 596
I really appreciate this, as PowerShell is something I've wanted to get into for a while. I've used it, but only minimally. This series will help me tremendously, I'm sure.

Rod
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