Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Sql Server Management Studio : How to Logon with different windows username???


Sql Server Management Studio : How to Logon with different windows username???

Author
Message
I.W Coetzer
I.W Coetzer
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
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


MarkusB
MarkusB
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4449 Visits: 4208

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
MarkusB
MarkusB
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4449 Visits: 4208

Sorry this should be

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

Markus



Markus Bohse
I.W Coetzer
I.W Coetzer
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
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


philcart
philcart
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2752 Visits: 1434
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
John Sinclair
John Sinclair
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 164
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
John Sinclair
John Sinclair
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 164
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.
I.W Coetzer
I.W Coetzer
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
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.


John Sinclair
John Sinclair
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 164
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.
Scott Begin
Scott Begin
SSC Veteran
SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)

Group: General Forum Members
Points: 246 Visits: 238

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.


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search