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»»

Sql Server Management Studio : How to Logon with different windows username??? Expand / Collapse
Author
Message
Posted Tuesday, September 11, 2007 1:43 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, January 29, 2010 1:32 AM
Points: 23, Visits: 105
Hi

How can I use Sql Server Management Studio to 'Connect' to a server using a different domain account?

I don't want it to use the logged in account, I want to be able to specify a different domain\username and password.

Any ideas?

I know I can create an admin Sql Server account but for this scenario I want to use another domain account.

Please help / advise

Thanks

Post #397973
Posted Tuesday, September 11, 2007 1:56 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 4:00 AM
Points: 4,427, Visits: 4,175

Ian,

even though you can type another windows name in the connection window, there are a couple of ways to do this.

1) Start SSMS with the "Run as" option.

2) In a Query Window use the "Execute AS LOGIN" command before executing a query.

The second option is especially usefull if you want to switch between users, while the first one offers the advantage that you can use Object Browser connections as well.

Markus

 



Markus Bohse
Post #397975
Posted Tuesday, September 11, 2007 1:57 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 4:00 AM
Points: 4,427, Visits: 4,175

Sorry this should be

"Even though you can't type another windows name".

Markus



Markus Bohse
Post #397977
Posted Tuesday, September 11, 2007 2:03 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, January 29, 2010 1:32 AM
Points: 23, Visits: 105

Hi

I can use things like remote desktop to log on to the server, and open ssms within the remote server! BUT I cannot locally open ssms.

RunAs does not work since I'm running this inside a Virtual PC Which is not like a PC on the domain using shared networking.

I can however (as mentioned in first paragraph)

1. I can remote desktop to servers on the domain and then enter my domain username + password (from within the virtual pc!!!)

2. I can view the internet after typing in the proxy settings and providing my domain username + password (from within the virtual pc!!!)

3. I can view file shares that I have access to after providing my domain username + password (from within the virtual pc!!!)

BUT I cannot use SSMS within the virtual pc!!! darn!

Let me know if this information helps, and if you know of a way I can use SSMS in this scenario.

Thanks

Post #397979
Posted Tuesday, September 11, 2007 2:40 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 10:44 PM
Points: 2,693, Visits: 1,213
You won't be able to use Window Authentication in SSMS from within a Virtual PC unless it's joined to the domain. Your only other option is to use SQL authentication.




Hope this helps
Phill Carter
--------------------
Colt 45 - the original point and click interface

Australian SQL Server User Groups - My profile
Phills Philosophies
Murrumbeena Cricket Club
Post #397993
Posted Wednesday, September 12, 2007 12:51 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Sunday, September 16, 2012 11:35 PM
Points: 48, Visits: 161
If you connect to the server or map a drive with the credentials you want to use first then those are the credentials that will be used for windows authentication with SQL server.

steps:

Disconnect all network connections to the server -
Open a command prompt (start-> run->enter "cmd")
type: "net use \\[servername]"
if you see any connections to the server, you must disconnect each one first with "net use /d \\[servername]\sharename"

now run:
net use \\[servername] /user[domain\[username]
you'll be prompted for your password. enter it. if you get a message about not being able to connect with different credentials, you didn't disconnect all other connections first.

Now just run SSMS as usual, and connect with windows auth. This works even if the machine you are connecting with isn't on the domain.

The same trick works with outlook/exchange. Its very handy
Post #398389
Posted Wednesday, September 12, 2007 12:54 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Sunday, September 16, 2012 11:35 PM
Points: 48, Visits: 161
You can map a drive to the virtual pc using one of the accounts on the vitual pc and specify the machine name instead of the domain name -for example, if the VPC hostname is "vm01" map a drive as "vm01\administrator" and enter the admin password when prompted.

Then run SSMS on your pc, point it at the VPC with windows auth.
Post #398391
Posted Wednesday, September 12, 2007 3:40 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, January 29, 2010 1:32 AM
Points: 23, Visits: 105

Hi John

I have tried your suggestion with net use, by first disconnecting the server and then running net use with my domain account, which worked after i entered my password.

But when I open ssms it still gives me this error message.

 

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Post #398429
Posted Wednesday, September 12, 2007 3:57 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Sunday, September 16, 2012 11:35 PM
Points: 48, Visits: 161
Hi Ian,

If you are trying to connect to SQL server on your virtual machine which isn't on the domain then you should connect using an account from the virtual machine, not your domain account.

Post #398430
Posted Wednesday, September 12, 2007 6:10 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, April 1, 2014 7:03 AM
Points: 245, Visits: 208

From my experience, if the computer running Management Studio isn't in the same domain (or trusted domain) as the SQL server, you can't use Windows Authentication to connect to the SQL server.  

The trick of mapping a drive to the SQL Server will work for other things that use windows authentication (such as computer management, SQL 2000 Enterprise Manager / Query Analyzer) just won't work with Management Studio.

One technique I haven't tried (and I could see the strange MS logic in using this) is to put an entry for the SQL server in the control panel, user accounts.  If this doesn't work, you will have to use a SQL Account.

Personally, I believe this is a design flaw.  In my environment, I constantly have consultants, vendors, etc. working on specific pieces of equipment.  By that definition, their laptops aren't in my domain and they can't use windows authentication from them.

Post #398459
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse