header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
SMO ManagedComputer object
Last Post 08 Oct 2009 10:50 AM by Chad Miller. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
rhavennUser is Offline
New Member
New Member
Posts:1
Avatar

--
01 Oct 2009 04:07 PM
    Hey Peeps,

    I'm trying to use PowerShell and SMO objects to query the available instances of a SQL 2008 server.

    I loaded the SQLWMIManagement class and then created a WMI.ManagedComputer object.

    However, the server I'm connecting to requires a SQL username and password and I get an error when trying to set the password for the connection.

    $m = new-object ('Microsoft.SQLServer.Management,SMO,WMI.ManagedComputer') 'TESTSERVER'
    $m.ConnectionSettings.username = "sa"
    $m.ConnectionSettings.SetPassword("password")
    $m.ServerInstances

    I tried set_Username("sa") as well. However,  both error out as access denied.

    If I create a Smo.Server object and use the set_Login and set_Password I'm able to connect fine to the same server. However, the Smo.Server object requires me to define named instances and I would rather just query a server for all available instances which the ManagedComputer object should provide.

    Any thoughs / suggestions?

    Thanks.
    Chad MillerUser is Offline
    Basic Member
    Basic Member
    Posts:160
    Avatar

    --
    08 Oct 2009 10:50 AM
    The ManagedComputer class uses WMI and only supports Windows authentication.
    You are not authorized to post a reply.


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