Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Power shell Expand / Collapse
Author
Message
Posted Monday, October 01, 2012 3:19 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, November 08, 2013 2:22 AM
Points: 51, Visits: 132
Hi guys,

I am new to powershell, can anyone please help me in undertanding powershell. I googled about powershell. But i dint get any clear idea about it.

I would like to know about, for what purpose we are using powershell.
And i need to use powershell for deployment. Please help me on this.
Post #1366411
Posted Monday, October 01, 2012 3:41 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 1:10 AM
Points: 1,533, Visits: 7,914
A good starting point would be the Stairways series available on this site: http://www.sqlservercentral.com/stairway/91327/.

There is also the book "Learn Windows Powershell in a Month of Lunches".


BrainDonor
Linkedin
Blog Site
Post #1366434
Posted Monday, October 01, 2012 3:59 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, February 24, 2014 1:10 PM
Points: 158, Visits: 755
For me the best book ever on Posh V2 :

Windows PowerShell In Action 2d, Bruce Payette


$hell your Experience !!!
Post #1366454
Posted Monday, October 01, 2012 2:24 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:25 AM
Points: 7,070, Visits: 12,523
vijayarani87.s (10/1/2012)
I would like to know about, for what purpose we are using powershell.

Three properties of a given task that compel me to use PowerShell or another managed programming language like C# or SSIS over using T-SQL to accomplish the same task:

1. The need to interact with a file system, e.g. deleting old files, renaming existing files, executing a program, etc. If you're considering using xp_cmdshell or one of the undocumented extended procedures like xp_dirtree, don't, explore using PowerShell or another managed programming language like C# or SSIS.
2. The need to interact with multiple database instances, e.g. gathering information about an environment where I want to run the same query against 1-n instances and compare or do something with the results. If you're thinking of using Linked Servers, don't, explore using PowerShell or another managed programming language like C# or SSIS.
3. The need to interact with a service outside the SQL database engine, e.g. Active Directory, a Web Service, SharePoint, etc. If you're thinking of using CLR or the OLE Automation procs, don't, explore using PowerShell or another managed programming language like C# or SSIS.


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1366759
Posted Monday, October 01, 2012 4:05 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 10:21 PM
Points: 35,951, Visits: 30,235
Heh... Or do like I do. Use xp_CmdShell to call PowerShell.

Of course, you should make sure you're system is properly locked down first.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1366813
Posted Monday, October 01, 2012 5:04 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:25 AM
Points: 7,070, Visits: 12,523
Jeff Moden (10/1/2012)
Of course, you should make sure you're system is properly locked down first.

Properly locking down your system, what exactly do you mean by that?


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1366828
Posted Monday, October 01, 2012 8:24 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 10:21 PM
Points: 35,951, Visits: 30,235
opc.three (10/1/2012)
Jeff Moden (10/1/2012)
Of course, you should make sure you're system is properly locked down first.

Properly locking down your system, what exactly do you mean by that?


It's simple. Only the DBAs have SA privs and no non-DBA user or app has been given a proxy to execute xp_CmdShell directly. They can only do it through a stored procedure that can't even see the content of.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1366850
Posted Monday, October 01, 2012 10:01 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:25 AM
Points: 7,070, Visits: 12,523
Jeff Moden (10/1/2012)
opc.three (10/1/2012)
Jeff Moden (10/1/2012)
Of course, you should make sure you're system is properly locked down first.

Properly locking down your system, what exactly do you mean by that?


It's simple. Only the DBAs have SA privs and no non-DBA user or app has been given a proxy to execute xp_CmdShell directly. They can only do it through a stored procedure that can't even see the content of.

Congratulations! You have boiled down 'Securing SQL Server' into less tHan 40 words!

The fact remains that enabling xp_cmdshell introduces risk into an environment and there simply is no reason one needs to enable it to manage a database.

For the original poster and any onlookers it is in your best interests to look beyond xp_cmdshell when evaluating how to solve an issue in SQL Server.


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1366858
Posted Tuesday, October 02, 2012 6:42 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 10:21 PM
Points: 35,951, Visits: 30,235
opc.three (10/1/2012)[hrThe fact remains that enabling xp_cmdshell introduces risk into an environment and there simply is no reason one needs to enable it to manage a database.



That fact remains that you still have an unreasonable fear of it. Unless you've made the mistake of enabling a non-SA-prived individual to use it, only SA's can use if. If you have it turned off and you're apps have SA privs, the first thing an attacker will do is turn it on. It won't even slow the attacker down because he'll be expecting it.

BWAA-HAAA!!!! And there's nothing wrong with summarizing the security of SQL Server in 40 words or less. Many people apparently don't understand the basic idea of "only DBAs get SA". Perhaps the additional 11 words of "Don't forget to turn off the guest and builtin admin accounts" would help?

xp_CmdShell is useless in the hands of an attacker because, in a properly locked down system, he can't get his hands on it. You need to concentrate on properly locking down your system because that's the real problem.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1366989
Posted Tuesday, October 02, 2012 9:04 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:25 AM
Points: 7,070, Visits: 12,523
Jeff Moden (10/2/2012)
opc.three (10/1/2012)[hrThe fact remains that enabling xp_cmdshell introduces risk into an environment and there simply is no reason one needs to enable it to manage a database.



That fact remains that you still have an unreasonable fear of it.

Sorry, but that dog won't hunt. All steps taken to prevent the use of xp_cmdshell are well-rooted in reason. It continues to astonish me that you are such an ardent proponent of it. Not only does it introduce risk into an environment but it might be one of the single-worst design choices for application development on the SQL Server platform.

Unless you've made the mistake of enabling a non-SA-prived individual to use it, only SA's can use if.

You're assuming that we as database professionals will be able to foresee and dictate all actions taken by someone with rights to change Active Directory. In a vacuum xp_cmdshell is harmless. In the real world it's a security risk. In a "properly locked down system" xp_cmdshell is disabled.


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1367105
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse