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 ««12

Use SSIS or SQL Server Agent to post to HTTPS site Expand / Collapse
Author
Message
Posted Wednesday, April 16, 2014 8:54 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:14 AM
Points: 5,672, Visits: 6,481
Powershell will do this?

ROCK ON. I've been looking for an excuse to learn this. Thanks for the links and the reference.


Brandie Tarvin, MCITP Database Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1562347
Posted Wednesday, April 16, 2014 9:00 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 7:35 PM
Points: 945, Visits: 2,737
If you can do it in C# it should be possible, and more likely easier to write, in PowerShell.


Shawn Melton
PS C:\>(Find-Me).TwitterURL
@wsmelton
PS C:\>(Find-Me).BlogURL
meltondba.wordpress.com
Post #1562348
Posted Wednesday, April 16, 2014 9:03 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:14 AM
Points: 5,672, Visits: 6,481
GAH.

Is this Powershell error normal?


Microsoft Team Foundation Server 2008 Power Tools\TFSSnapin.ps1 cannot be loaded because running scripts is disabled on this system.


It gives me a link for execution polices on Microsoft's servers, but at first glance, nothing that actually explains the error.


Brandie Tarvin, MCITP Database Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1562349
Posted Wednesday, April 16, 2014 9:17 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 7:35 PM
Points: 945, Visits: 2,737
Brandie Tarvin (4/16/2014)
GAH.

Is this Powershell error normal?


Microsoft Team Foundation Server 2008 Power Tools\TFSSnapin.ps1 cannot be loaded because running scripts is disabled on this system.


It gives me a link for execution polices on Microsoft's servers, but at first glance, nothing that actually explains the error.

Default on Windows (desktop and server) is for scripts to not be executed. You have to set this either at the domain level or per machine. This is the security by default.

The general guideline is setting it to RemoteSigned. This provides some level of security without causing to much hassle and requiring every little script to be signed.


Shawn Melton
PS C:\>(Find-Me).TwitterURL
@wsmelton
PS C:\>(Find-Me).BlogURL
meltondba.wordpress.com
Post #1562352
Posted Wednesday, April 16, 2014 9:32 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:14 AM
Points: 5,672, Visits: 6,481
Thanks.

Brandie Tarvin, MCITP Database Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1562360
Posted Wednesday, April 16, 2014 11:53 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:14 AM
Points: 5,672, Visits: 6,481
Another question. Once I finish writing up the Powershell script, how do I make it part of the SSIS package or the SQL Server Agent job?

Is it as simple as calling it in a .bat file or using the Execute Process Task?


Brandie Tarvin, MCITP Database Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1562405
Posted Wednesday, April 16, 2014 12:58 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 7:35 PM
Points: 945, Visits: 2,737
Brandie Tarvin (4/16/2014)
Another question. Once I finish writing up the Powershell script, how do I make it part of the SSIS package or the SQL Server Agent job?

Is it as simple as calling it in a .bat file or using the Execute Process Task?

You can do either one, it just depends on how you want to organize it.

If you want to keep it all in SSIS:
I would probably suggest using an execute process task, it will ensure any errors with the PowerShell script itself trickle up so the task would fail properly.

If you want to use SQL Agent:
Setup your SQL Agent job with two steps, your first step is your SSIS package and then your second one will be a PowerShell type step. This will execute the script from the context of SQLPS. Because of that you will need to ensure your first line includes
$erroractionpreference = "Stop"

to ensure PowerShell errors cause the step to fail properly. By default it is set to "continue" which causes the step to show successful even though an error may have occurred.


Shawn Melton
PS C:\>(Find-Me).TwitterURL
@wsmelton
PS C:\>(Find-Me).BlogURL
meltondba.wordpress.com
Post #1562424
Posted Thursday, April 17, 2014 1:49 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:14 AM
Points: 5,672, Visits: 6,481
FYI: Followup Powershell question at http://www.sqlservercentral.com/Forums/Topic1562838-1351-1.aspx

If I weren't on a deadline of three days ago, this wouldn't be so hard and I'd already have my answer. I just know it... Sigh.


Brandie Tarvin, MCITP Database Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1562842
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse