Solved

How to use command-line commands to log in a domain?

Posted on 2009-06-30
8
2,275 Views
Last Modified: 2012-06-27
I have some users in Sales department visiting several different sister companies in our group. Each sister company has their own domain. When they visit, they want to use the local resources such as printers, scanners, network drivers, etc. I want to know if there is a way of loging to a domain by using command-line commands so I can plug them in the login script. With this, they will be able to login to the local domain whichever company they visit.
Thanks.
0
Comment
Question by:Castlewood
  • 3
  • 3
  • 2
8 Comments
 
LVL 6

Expert Comment

by:brasslan
Comment Utility
net use t: \\server\common /user:chris 12345

That will map the local T: drive to the common share on the server using the username chris and password 12345

You can also change the username to the format "domain\user"  eg microsoft\bill will use the username bill on the Windows domain microsoft.

If you just simply want to login to a server, but not map a drive, then just leave out the drive letter and that will process the initial login.
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
I don't think the above mentioned approach will suffice, as you need to use the same server name and at least one common share in all domains, and it does not allow for usage of domain resources, only for that single server.

If you make sure the local account is replicated into all domains (including the same password), you shouldn't have any problems browsing the local domain and using its resources. The laptop users will stay local, but whenever they access the domain, they will do with the domain account with same name.

It could be necessary to have the laptop be part of the local domain - that would be difficult, as you can only have ONE domain membership.

(I assumed those users are accessing domain resources with their own laptop on travelling.)
0
 

Author Comment

by:Castlewood
Comment Utility
Qlemo, the domains are not under the same tree so there is no replication between. You are correct that those users are accessing domain resources with their own laptop on travelling. When they turn power on and login to their own laptops it is their "home" domain they log into using the user's profile. I think the question is more like: can they log in to multiple domains? If yes, how and what commands to use in user's login script?  

We currently use "net use". It seems cumbersome since there are so many resources to share. If they can log into the local domain by a command, it will be really awesome.

Can Net Use be used to share for an entire domain's resources, instead of just per server? If not, Net Use is not sufficient, since it is the command we currently use.
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
Net use can't do that. It authorizes against a single server only, not the domain.

With "replication" I ment a manual way of duplicating related accounts to all domains. Which makes only sense if you have no account changes (including passwords), or a connection between all domains (at least at a single point of access).

You cannot be member of more than one domain at any time. You can change the logon domain, but I do not know (as I never tried) if that is really feasible with changing domains. The reg key for login domain is
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ WindowsNT\CurrentVersion\Winlogon\DefaultDomain
You can try to change that and if it would work. The laptop will have to be member of the domain, I reckon. This is something you have to do once for each laptop in each domain.

0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 6

Expert Comment

by:brasslan
Comment Utility
I agree with Qlemo that you can only join one domain.  And since these domains are separate and not under the same tree, there is no way to log in to multiple domains.

If I had this problem, I would have setup a more complicated login script that would detect which network I'm on, then run the appropriate login commands to login to the individual servers that had the needed network resources.

But I didn't know that you could replicate local user accounts across a domain like Qlemo suggested.  If that isn't too hard, then it might prove to be a better solution.
0
 
LVL 6

Accepted Solution

by:
brasslan earned 250 total points
Comment Utility
Oops, I was really slow in posting my last post and didn't see Qlemo's last note...

You can't change your registry to login to another domain.  You need more than a user account to login from a windows computer, you also need a computer account listed in the active directory on the domain as well.  As you know, after deleting a computer from Active Directory Users and Computers, no one can login to the domain from that PC anymore.
0
 

Author Comment

by:Castlewood
Comment Utility
Wait, does a computer need to join the domain before the user using this computer can login to this domain ??
0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 250 total points
Comment Utility
Only on a member computer you can login in using the domain account. However, if the domain account and the local account are the same (and using the same password), it should work, but it could also be necessary to login on each server providing the domain user.

We use that kind of login on most workstations (local login, domain login data = local login data), and for access between the workstations you have to give explicit domain login (sometimes).
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now