0

I got access to SQL Azure. My problem is I can see Powershell in my local system but not in remote Sql server.

Through SSMS I can access SQL Azure and I can see the Databases and I can create database, but I can't use Powershell.

In my local sql server I used Powershell to send the http request like

$http_Request = New-Object system.Net.WebClient;
$Result = $http_Request.downloadString("url");

It was working fine, but when I try the same thing in SQL Azure I can't. any help?

niren
  • 2,693
  • 8
  • 34
  • 58
  • What the error mesg on remote SQL server? – Peter Aug 01 '13 at 14:44
  • In my local sql server I can see `Start Power Shell` by right click on Dabases. But I don't see the same thing in remote SQL server. – niren Aug 01 '13 at 14:48
  • I tried from query editor as well like `xp_cmdshell 'powershell.exe -command "New-Object system.Net.WebClient"'`, It shows me error `Could not find stored procedure 'xp_cmdshell'.` – niren Aug 01 '13 at 14:50
  • I tried to execute `xp_configure` to enable `xp_cmdshell`, It shows me same error `Could not find stored procedure 'xp_configure '.` – niren Aug 01 '13 at 14:51
  • The versions of the local sql server and remote sql server are the same? – Peter Aug 01 '13 at 15:31
  • They are different version, My local sql server:Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (Intel X86) Dec 28 2012 19:06:41 Copyright (c) Microsoft Corporation Express Edition on Windows NT 6.1 (Build 7601: Service Pack 1) and remote server: Microsoft SQL Azure (RTM) - 11.0.9099.37 Jul 5 2013 23:16:50 Copyright (c) Microsoft Corporation – niren Aug 01 '13 at 15:43
  • check if the snap-in installed `Get-PSSnapin -Registered` on remote server. This site might help: http://stackoverflow.com/questions/13311451/no-snap-ins-have-been-registered-for-windows-powershell-version-2 – Peter Aug 01 '13 at 15:52
  • How can I check if the snap-in installed, I tried the link you gave but I don't understand since am new to database. – niren Aug 01 '13 at 16:37
  • Try to launch it from "all programs" in operating system not through db. – Peter Aug 01 '13 at 17:00
  • `"all programs" in operating system` I don't get. – niren Aug 01 '13 at 17:03
  • You might need to login to remote system through remote desktop service client. Or you can use the way described in "executing a remote command" part in this link: http://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/. You need modify the computer name to your remote server. – Peter Aug 01 '13 at 17:14
  • @Peter I can access only database not system, anyhow I tried with Remote Desktop connection from my system to connect Remote SQL server, but no use. – niren Aug 02 '13 at 11:26
  • you might need to talk to your system admin or db admin for permission. Or they should check for you. – Peter Aug 03 '13 at 14:06

0 Answers0