Solved

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

Posted on 2009-06-30
8
2,277 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
ID: 24747918
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 69

Expert Comment

by:Qlemo
ID: 24748105
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
ID: 24749597
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 69

Expert Comment

by:Qlemo
ID: 24749694
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
 
LVL 6

Expert Comment

by:brasslan
ID: 24749841
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
ID: 24749883
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
ID: 24750358
Wait, does a computer need to join the domain before the user using this computer can login to this domain ??
0
 
LVL 69

Assisted Solution

by:Qlemo
Qlemo earned 250 total points
ID: 24752814
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

17 Experts available now in Live!

Get 1:1 Help Now