Link to home
Start Free TrialLog in
Avatar of Castlewood
Castlewood

asked on

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

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.
Avatar of brasslan
brasslan

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.
Avatar of Qlemo
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.)
Avatar of Castlewood

ASKER

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

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.
ASKER CERTIFIED SOLUTION
Avatar of brasslan
brasslan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wait, does a computer need to join the domain before the user using this computer can login to this domain ??
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial