25

Occasionally I need to log into a local machine account on a Windows workstation joined to our domain. The syntax for specifying a domain account looks like this:

DOMAINNAME\myusername

whereas the syntax for logging into a local account is

HOSTNAME\myusername

The problem is that I often don't know the host name off the top of my head. It is possible to find out by clicking the "How do I log onto another domain" link, but this requires me to memorize or write down an often cryptic hostname. Is there another, simpler way to do this?

  • This is Windows 7? – Supercereal Feb 17 '11 at 14:48
  • Either Vista or Windows 7. If there's a Windows 7-only solution, I'd still like to know. Thanks. – David Feb 17 '11 at 14:53
40

You can use a period to represent the local host name when logging in.

So, .\Administrator would be the local administrator account.

| improve this answer | |
  • That's exactly what I was looking for. Thanks! It works on both Vista and Windows 7, at least. – David Feb 17 '11 at 15:58
  • 7
    This works fine locally, but does not work through RDP because it will specify the local rather than host domain. Is there any shortcut possible via RDP? – djs Jun 25 '13 at 20:39
  • 2
    @djs you know the machine name that you're connecting to if you're using RDP. Or you can do nslookup on the IP address if you connect that way. Doesn't stop you having to type it in though – laurencemadill Mar 19 '14 at 16:47
  • Also works in Windows 10. Great. Thanks. – monojohnny Oct 4 '18 at 15:41
0

You can also use "local" to represent the name of the machine you're logging into.

So local\Administrator would be the local admin account on the server you're logging into.

I find this useful when RDP'ing into a remote server. The .\Administrator trick doesn't work in RDP because it will resolve that to <my client machine name>\Administrator, not <remote server name>\Administrator.

In general I find it shorter to type "local" than the remote machine name. It also makes it easy to create a new saved connection from an existing one - just change the server name then Save As to save the modified connection, no need to change the user name (assuming you use the same local admin account name on all your remote servers, eg they're all named <host name>\Administrator, or all named <host name>\LocalAdmin).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.