Powershell SQLServer Connect via New-PSDrive

Hello,
I try to connect to a local SQL Database running SQLServer 2012.
I can not connect with my local account, but have to use a dedicated account.
I tried the following:
Import-Module SQLPS -DisableNameChecking
PS SQLSERVER:\> $cred = Get-Credential
PS SQLSERVER:\> New-PSDrive sqldrive -PSProvider SqlServer -Root SQLSERVER:\SQL\DB01-LT\DEFAULT -Credential $cred
Name           Used (GB)     Free (GB) Provider      Root                                               CurrentLocation
sqldrive                               SqlServer     SQLSERVER:\SQL\DB01-LT\DEFAULT+sa
($cred is valid, of cause)
For me, everything seems good, but if I try to browse the psdrive I get an error.
PS SQLSERVER:\> dir sqldrive
Get-ChildItem : Cannot retrieve the dynamic parameters for the cmdlet. SQL Server PowerShell provider error: Path SQLSE
RVER:\sqldrive does not exist. Please specify a valid path.
At line:1 char:4
+ dir <<<< sqldrive
+ CategoryInfo : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
+ FullyQualifiedErrorId : GetDynamicParametersException,Microsoft.PowerShell.Commands.GetChildItemCommand
Does anyone can give me a hint, why this is not working.
I searched the Internet and found a lot of examples using exactly this commands.
Thank you very much in advance.
BR
Matthias

Hi Matthias,
I'm confused why the root path has been changed to "SQLSERVER:\SQL\DB01-LT\DEFAULT+\sa", please try to copy and paste the script I posted.
For more detailed information about sql PSdriver, please follow this article:
Weekend Scripter: Use PowerShell to Work with SQL Server 2012 Database Objects
If there is anything else regarding this issue, please feel free to post back.
If you have any feedback
on our support, please click here.
Best Regards,
Anna
TechNet Community Support

Similar Messages

  • How to avoid syslog messages when connecting via Perl SAP::RFC ?

    Everything works fine with Perl SAP::RFC calls to our ERP 6.0 thanks to Piers Harding except numerous entrys in the SAP-syslog (SM21) which make that a little bit unclearly.
    Tracing is set to "0" when connecting via new SAP::Rfc( ASHOST .. , TRACE    => "0" ) from Perl.
    The syslog - entries look something like this:
    07:46:10 DIA 000                          R1  M Trace vom Remote Client übernommen.       
    07:46:18 UP2 062 011 MYRFCUSER              R1  L Trace für Benutzer MYRFCUSER deaktiviert.
    Even when tracing is set to "0" there is also a *.trc-File in the directory where the perl script resides on RFC client side.
    In this trace file one can see the followig excert:
    >>> RfcOpenEx ...
    Got following connect_param string:
       TRFC=0 LCHECK=0 UNICODE=0 PASSWD=******* USER=MYRFCUSER LANG=DE *TRACE=CLIENT=011* ASHOST=myhost SYSNR=00
    Send RFCHEADER: 01/LIT/IEEE/SPACE/1100
    Send UNICODE-RFCHEADER: cp:1100/ce:IGNORE/et:5/cs:1/rc:0x00000023
    Could someone please give me a hint what is going wrong here.
    Thank you.
    Martin

    May be set TRACE->'1' and got tracing messages ?

  • SCCM 2012: remotely connect via powershelll: no psdrive

    Hi,
    I'd like to connect via powershell to a remote sccm-server.
    What I did:
    Run powershell x86
    enter-PSSession -ComputerName sccm2012 -ConfigurationName Microsoft.PowerShell32
    Set execution policy to unrestricted
    Import-Module ‘c:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1’
    Get-psdrive to see connections (in order to change to sitecode via cd  sitecode)
    but the site does not appear (connected remotely also via sccm 2012 console and launched "connect via powershell").
    Please advise.
    J.
    Jan Hoedt

    You need some reg keys for this to work. Those reg keys are normally created by the console when you start it.
    $CMSiteCode = "P01" #Your site code
    $CMSiteServerFQDN = "sccm2012.domain.tld" #FQDN to your site server
    New-Item -Path HKCU:\Software\Microsoft\ConfigMgr10\AdminUI\MRU\1 -Force
    New-ItemProperty -Path HKCU:\Software\Microsoft\ConfigMgr10\AdminUI\MRU\1 -Name DomainName -Value "" -PropertyType String -Force
    New-ItemProperty -Path HKCU:\Software\Microsoft\ConfigMgr10\AdminUI\MRU\1 -Name ServerName -Value $CMSiteServerFQDN -PropertyType String -Force
    New-ItemProperty -Path HKCU:\Software\Microsoft\ConfigMgr10\AdminUI\MRU\1 -Name SiteCode -Value $CMSiteCode -PropertyType String -Force
    New-ItemProperty -Path HKCU:\Software\Microsoft\ConfigMgr10\AdminUI\MRU\1 -Name SiteName -Value "Primary Site $($CMSiteCode)" -PropertyType String -Force
    Use the script above before you import the CM-PoSh-Module, I've used it for some of my customers.
    Tim Nilimaa | Blog: http://infoworks.tv | Twitter: @timnilimaa

  • Connect via Windows Powershell in SCCM 2012 CONSOLE (with PowerShell 4.0 installed)

    Hi,
    When trying to "Connect via Windows Powershell" in the SCCM 2012 console, I get the message that Powershell 3.0 is not installed... (which actually isn't installed, we have PS4.0 installed). Do we need to install PS3.0 also to get it working
    or is there a workaround? Connecting manually to the site via Powershell 4.0 (Get-Psdrive -psprovider CMSITE) works like a charm.
    Regards,
    WiM

    Hi,
    I have installed WMF 4.0 on Windows Server 2008 R2 sp1, it works fine.
    Please try to use "$PSVersionTable" to confirm Powershell version is 4.0. At first, I forgot to install Microsoft .NET Framework 4.5, then the console gave me the message that Powershell 3.0 is not installed.
    Best Regards,
    Joyce Li
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How do I connect my new (purchased last week) macbook air to my samsung smart tv? I purchased the adapter at the apple store and connected to the TV via HDMI cable.  The TV says "no signal.  I do not see TV as an option in the display tab of system prefer

    how do I connect my new (purchased last week) macbook air to my samsung smart tv? I purchased the adapter at the apple store and connected to the TV via HDMI cable.  The TV says "no signal.  I do not see TV as an option in the display tab of system preferences.  what else do I need to do?

    First, make sure your TV is tuned to display the correct input signal. Most TVs have several inputs (multiple HDMIs, cable connections, RCA etc) so double-check that you're using the correct one - HDMI1, HDMI2 or whatever is written next to the port.
    I assume that you have a mini-Displayport to HDMI adaptor? If you open displays preferences, first tick the box that says "show display preferences in menu bar" then locate the menu and click Detect Displays. See if that helps.
    Matt

  • I have the new IPad and can't connect via bluetooth to any of my apple devices (IPhone 4s and appleTV) neither from my new IPhone 4s. When I turn the Bluetooth on, both devices keep in searching mode... I don't know what to do now... Please help

    I have the new IPad and can't connect via bluetooth to any of my apple devices (IPhone 4s and appleTV) neither from my new IPhone 4s. When I turn the Bluetooth on, both devices keep in searching mode... I don't know what to do now... Please help... I can't pair any device because they can't find whitin themselves.

    Wmorlac wrote:
    I have the new IPad and can't connect via bluetooth to any of my apple devices...
    Correct... See Supported Bluetooth Profiles Here...
      http://support.apple.com/kb/HT3647
    Suggest you check the User Guides of your Devices to find the Method of what you are trying to do

  • How can I create a new folder in an external disk that is connected via USB to my Mac?

    How can I create a new folder in an external disk that is connected via USB to my Mac?

    Just like you would create a new folder anywhere. Open the drive's icon from your desktop or the Finder, and click shift-command-N. (Or use the Finder menu if you prefer - File - New Folder).
    If you can't create a folder, your drive may be the wrong format (you can't write to a Windows/NTFS formatted drive, for example). You'll have to back up any files you have on there, and then use Disk Utility to reformat it to Mac Extended (if it will only be used on a Mac) or MS-DOS format (if you want to share it with a PC).
    Matt

  • Can't Connect Via Ethernet on new MacBook Pro

    Hello,
    I'm running into a frustrating problem and hoping someone can help.
    I have a new MacBook Pro that won't connect via Ethernet. My old computer (Powerbook G4) with the same settings works flawlessly.
    Details: under Network Settings I have Automatic/Using DHCP. When I click on Assist Me>Diagnostics, I get green lights all the way down (Built-In Ethernet, Network Settings, ISP, Internet, Server). The Diagnostics tool therefore proudly announces that my Internet connection is working correctly.
    When I open Safari, however, it won't open any page. Using Ping I also get no responses.
    When I plug the exact same ethernet cable into my Powerbook G4, everything works flawlessly. The only difference is that the IP address ends in .25 instead of .30 (I assume that's from the router assigning different IP addresses to the two computers.)
    On another forum i read about someone having a problem with a long/lossy ethernet cable, but I just took my computer to the router and tried with a 2-foot ethernet cable. Same situation.
    Help!
    Thanks

    i rebooted the firewall and it worked.

  • Pioneer 8400 DVD receiver player, as iPhone ios6 update now when connecting the new iPhone with ios6 via blutooth (firmware prob) to my car DVD 8400 unit, when playing music such as on my phone or Pandora the track button does not function or work at all

    pioneer 8400 DVD receiver player, as iPhone ios6 update now when connecting the new iPhone with ios6 to my car DVD 8400 unit, when playing music such as on my phone or Pandora the track button does not function or work at all not even if i press skip track forward or back on the unit it doesn't function everything works except that. on listening to radio or anything else related not pairing thru Bluetooth unit works fine, seems there to be Bluetooth update that is not making iPhone and unit not compatible at all. does pioneer need fix this problem with update firmware or thru apple need help. my iPhone was working fine before with previous ios 5 before.

    Dear Valued Pioneer Customer:
    We would like to inform you of the availability of an optional Bluetooth® firmware update (HW05-SW01.27.20) that enables Bluetooth AVRCP control and metadata display from a compatible Pioneer CD or DVD Receiver when used with an iPhone® 5 or iOS 6 device.  If you do not own an iPhone 5 or iOS 6 device, there is no need to install this update.
    This firmware update may be used only with the following 2012 Pioneer products:
    CD Receivers
    DVD Receivers
    DEH-P8400BH
    DEH-P9400BH
    DEH-80PRS
    AVH-P2400BT
    AVH-P3400BH
    AVH-P4400BH
    AVH-P8400BH
    In order to perform this update, the following items are needed:
    A Pioneer CD or DVD Receiver above with built-in Bluetooth
    Laptop with built-in Bluetooth running Windows® 7
    Bluetooth firmware update (HW05-SW01.27.20)
    How to Obtain the Free Firmware Update
    1. Download the INSTRUCTIONS for the optional Bluetooth firmware update (HW05_SW01.27.20).
    2. Download the UPDATE FILE to a computer and transfer the file to a compatible 2012 Pioneer CD or DVD Receiver via a Bluetooth-enabled Windows 7 laptop.
    You can also arrange for Pioneer to update your 2012 Pioneer CD or DVD Receiver by calling Pioneer Customer Service toll free at 800-421-1404 during regular business hours (M-F 10AM-7:30PM Eastern Time, except on holidays). If this firmware update is performed by Pioneer, there is a charge of $60.00 (this charge includes return shipping of the updated unit within the U.S.). Charges for removal/reinstallation of the unit and shipment to Pioneer are the customer’s responsibility.
    How to Determine if the Firware Update has Already been Installed
    CD Receivers:
    • With the unit turned off (press and hold the source button until the CD Receiver turns off), press and hold the center of the volume knob to bring up the Settings menu → rotate the volume knob until "BT Version Info" is displayed and then press the center of the volume knob → The firmware version should show HW05-SW01.27.20.
    DVD Receivers:
    • With the unit turned off (press the home button and select ‘OFF’ from the source icons), press the home button → Press the “System” icon at the bottom of the screen → Select the “Bluetooth Version Info” option → The firmware version should show HW05-SW01.27.20.
    If the Bluetooth firmware version shows HW05-SW01.27.20, no further action is necessary.
    Questions
    If you have any questions, please contact the Pioneer Customer Service Center toll free at 1-800-421-1404, Monday through Friday, 10:00 a.m. to 7:30 p.m. (Eastern Time), except on holidays.
    Sincerely,
    Pioneer Electronics (USA) Inc.

  • Just bought new iPod touch. When I connect to computer to sync it tells me "iTunes could not connect to this iPod touch. Could not send a message to device." Not sure if it is b/c of an older version of iTunes but connecting via wifi sync unacceptabl

    Just bought new iPod touch. When I connect to computer to sync it tells me "iTunes could not connect to this iPod touch. Could not send a message to device." Not sure if it is b/c of an older version of iTunes but connecting via wifi sync unacceptable

    What version of iTunes is on the computer? You need at least 11.4.

  • Brand new A655 Satellite Laptop will connect to new Vizio lcd but not older Plasma tv via HDMI

    Hey guys,
    So i just purchased a brand new Toshiba Satellite A665-S5183X and It works great with my new smaller bedroom LCD TV via HDMI and automatically connects when I plug in the HDMI.
    HOWEVER, my older HP 42" Plasma connected via HDMI will not recognize each other.  The TV says it isnt receiving signal and the laptop isnt showing a 2ndary display in the graphics settings.  The HDMI cord works and I watch COX via HDMI to the older plasma tv.....
    what gives???

    sorry, let me say im for the most part tech savory. So the FN+f5 only shows the laptop display and not the tv.
    If i carry the cable into my bedroom for the newer Vizio LCD tv, the computer automatically detects it and connects it. It is seen in FN+F5 or the graphics control panel.
    When i do the same for my main older plama tv, it wont detect it. Nor does my plasma tv sense a signal from the laptop....something must need updated....but what??

  • Setting up new imac on network using dhcp nut not getting a valid ip address. Same happens when I try to connect via wi-fi. IP address being assigned is 10.45.190.195

    Have new Imac that I'm setting up. Company is using DHCP to manage IP addresses. Mac is plugged into netgear hub along with a PC. Mac is getting an invalid IP address of 10.45.190.195. PC is working fine. I've powered the hub on and off. I've renewed th DHCP lease on the Mac many times but IP address always comes back as 10.45.190.195. I've plugged the network cable directly in the network port bypassing the hub. Same result.
    Having the same issue when trying to connect via Wi-Fi,
    Anyone experiencing this issue?

    I see what you are saying. When I lived in the dorms, I was set up in bridge mode because we had that type of modem. My question now is do I distribute a range of static IP's or share a public? Either of these settings give me errors where the starting and ending DHCP addresses conflict. I use 10.0.1.1 and 10.0.1.100 and this error no longer seems to persist, but then I am not able to connect to the internet and the amber light keeps flashing- along with my computer showing that I am still connected to the TM.
    Thank you for your support so far.

  • My Internal HD became corrupt and it would not boot up so I installed My osx onto a new HD via usb and then inserted into my macbook pro but it wont boot up. It will only boot up if i connect via usb how can i boot it as an internal HD?

    My Internal HD became corrupt and it would not boot up so I installed My osx onto a new HD via usb and then inserted into my macbook pro but it wont boot up. It will only boot up if i connect via usb how can i boot it as an internal HD?

    Shootist007 wrote:
    If the system won't boot from the new drive the OP bought and install OS X on it it certainly won't boot from the original drives Recovery HD partition.
    Sorry genius.....but if the Recovery disk shows up that means the disk cable isn't bad.  Could be he did have a screwed up HDD and when he put the NEW HDD in (after putting the OS on it via USB) the computer didn't reconize it and therefore didn't boot the OS.  Just maybe right genius?  Don't rush to criticize someone's recommendations until you realize other possibilities.  (I did say "if it does")
    Thank you

  • Can't connect my new iPhone 4 with internet via Time Capsule. IP4 recognized TC but will not connect with it. (Password etc. is ok)

    Can't connect my new iPhone 4 with internet via Time Capsule. IP4 recognized TC but will not connect with it. (Password etc. is ok)

    Do the usual wireless things.
    Change the wireless name to simple name with only alphanumerics and no spaces.
    Set to manual and use channels 1, 6, 11 in turn.
    For testing take off the security altogether.
    The iphone only works on 2.4ghz so only that band is relevant.

  • HT201250 I have had my mac stolen, I have an external HD I connect via USB for these time machine backups, I now have a new replacement mac and wish to restore from my external HD, migration assistant doesn't seem to recognise or see my drive ? please hel

    I have had my mac stolen, I have an external HD I connect via USB for these time machine backups, I now have a new replacement mac and wish to restore from my external HD, migration assistant doesn't seem to recognise or see my drive ? please help

    See Pondini's Excellent information here...
    Setting-up a new Mac from an old one, its backups, or a PC
    See the  Second Chance to Use Setup Assistant  here...
    http://Pondini.org/OSX/SetupLion.html

Maybe you are looking for

  • Trouble downloading itunes

    I recently had to restore my computer to factory condition... this erased the itunes on my computer. when i plug my ipod nano in and try to download the itunes version 7 it comes up with a message saying: unknown publisher. someone please help!!!!

  • Interactive PDF button to export form data to separate PDF

    Hi, I'm creating a 10 page interactive PDF. One page of the PDF is a questionnaire which i've made using form fields. I basically want the user to answer the questions in the form fields and then click a button on the page that will save that page (w

  • Auto save: document will not open in

    When I went to save a document for the first time, Appleworks crashed on me. I immediately went into my auto saved file to retrieve the doc but got an "unexpected end of file" message. What does that mean? How come other document will open from the a

  • JAVA Mapping: XMLSPY vs. DOM4J/JAXEN

    Hi everybody, I get "Invalid XPath expression errors" when I use the expressions: <i>List results = document.selectNodes("/books/book[(details/(price!='100'))]"); </i>        or <i>results = document.selectNodes("/books/book[(details/not(price='100')

  • Error in itunes store

    There are a bunch of songs that when i try to play them it says i need to authorize it to play it, but when i enter my apple ID and password it says "We could not complete your itunes store request. the file or directory is corrupted and unreadable.