header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

We have a new sponsor!  Introducting Pragma Systems.  See the home page for details.

running powershell from SQL
Last Post 28 Jan 2009 10:23 PM by cmille19. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
ITUser is Offline
New Member
New Member
Posts:55
Avatar

--
28 Jan 2009 02:14 PM  
I am trying to run a PowerShell script  from an SQL script.
halr9000User is Offline
PowerShell MVP, Site Admin
Advanced Member
Advanced Member
Posts:524
Avatar

--
28 Jan 2009 02:24 PM  
Can you run shell commands from T-SQL? I don't know it that well. I do know however that you can run PowerShell stuff from within the management studio for SQL 2008. Probably in Agent jobs as well, although I've not tried.
Community Director, PowerShellCommunity.org
Co-host, PowerScripting Podcast
Author, TechProsaic
ITUser is Offline
New Member
New Member
Posts:55
Avatar

--
28 Jan 2009 02:26 PM  
I know that you can run PowerShell from management studio, but I was seeing if anyone knew the script to do so.
cmille19User is Offline
New Member
New Member
Posts:61
Avatar

--
28 Jan 2009 10:23 PM  

Provided xp_cmdshell is enabled you can execute something like this.

xp_cmdshell 'powershell.exe -c get-service'

You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 footer
footer