Page 1 of 1 1
Topic Options
#181737 - 2007-10-17 11:15 PM Mapping drives using remote credentials
Godkarmachine Offline
Fresh Scripter

Registered: 2007-10-17
Posts: 5
Hi, noob here with what will probably be a noobish question:

I'm writing a login script for an environment that has some domain users and some local users. Part of the script maps drives from our file server; the local users have matching local accounts set up on the file server end, with the same user name and password; thus, they can impersonate this account and gain access to their file shares.

The problem comes when using the login script to map these shares. Right now, I am checking the server group membership with ingroup(\\servername\groupname). This works for the domain accounts, but oddly enough, it doesn't work at all for the local accounts; it seems like the ingroup command doesn't support the impersonation.

Any ideas how I can make sure that the local users can still log into their network shares?

Top
#181738 - 2007-10-17 11:28 PM Re: Mapping drives using remote credentials [Re: Godkarmachine]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I don't get it. Is that file server a member server or a stand-alone server?
Top
#181739 - 2007-10-17 11:50 PM Re: Mapping drives using remote credentials [Re: Witto]
Godkarmachine Offline
Fresh Scripter

Registered: 2007-10-17
Posts: 5
It's a member of the domain; however, several of the workstations accessing it aren't, which is the reason for the local accounts.
Top
#181746 - 2007-10-18 04:21 AM Re: Mapping drives using remote credentials [Re: Godkarmachine]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Can't do that automatically as Kixtart doens't know the password. you would need to prompt the user for their password or integrate the local/standalones into the domain.
_________________________
There are two types of vessels, submarines and targets.

Top
#181769 - 2007-10-18 08:50 PM Re: Mapping drives using remote credentials [Re: Sealeopard]
Godkarmachine Offline
Fresh Scripter

Registered: 2007-10-17
Posts: 5
Assume username/password is the same for the server account as for the workstation account; is there then a way to implement this?
Top
#181773 - 2007-10-18 11:45 PM Re: Mapping drives using remote credentials [Re: Godkarmachine]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
If the userid and the password are the same local and in the domain, I presume this works:

Use '\\Server\Share\Deeper' /User:'Domain\'+@USERID

Top
#181786 - 2007-10-19 06:29 PM Re: Mapping drives using remote credentials [Re: Witto]
Godkarmachine Offline
Fresh Scripter

Registered: 2007-10-17
Posts: 5
Thanks for that; however, that's not really the part I'm having a problem with.

Let me try to simplify things a bit:

Let's say I've got a user, Bob. He's got a local account on his workstation, \\WKSTA1\Bob, and a server account, \\SERVER1\Bob. There's also a group on the server, \\SERVER1\Supervisors, that has a special shared folder that holds files Bob needs to do his job.

Now, if I were checking for local group memberships for Bob, I could just use ingroup() in an IF statement. However, what I want to check is actually the group memberships for the server account. I've tried this:

 Code:
If Ingroup("\\SERVER1\Supervisors")
use s: "\\SERVER1\Supv Share"
EndIf


The problem is, the if never seems to trigger (I suspect because we're technically talking about 2 separate accounts, and the ingroup() command doesn't support the impersonation). I've tested this without the if, and it mounts the drive, which just supports my theory.

Anybody got any other ideas?

Top
#181789 - 2007-10-19 07:04 PM Re: Mapping drives using remote credentials [Re: Godkarmachine]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
maybe first let Bob logon to IPC$
Use '\\Server\IPC$' /User:'Domain\'+@USERID

Top
#181794 - 2007-10-19 08:32 PM Re: Mapping drives using remote credentials [Re: Godkarmachine]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
Questions:
- How are the users running the logon script? (How is the logon script getting started?)
- Why are the users not logging into the domain?
- Are the PCs part of the domain?

This is not an impersonation problem, but more that Ingroup will not work the way you are trying to use it. There may be another way, but the only way I can see you getting this to work with ingroup, is to create a local group on each pc called Supervisors, and stick the user in it.

Top
#181801 - 2007-10-20 03:51 AM Re: Mapping drives using remote credentials [Re: Allen]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The problem is that you still need to somehow provide the password. Just because the password is the same between the local and domain accout desn'tmean Windows would use it. I would even consider such a behavior a significant security hole.
_________________________
There are two types of vessels, submarines and targets.

Top
#181803 - 2007-10-20 08:30 PM Re: Mapping drives using remote credentials [Re: Sealeopard]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
 Originally Posted By: Sealeopard
The problem is that you still need to somehow provide the password. Just because the password is the same between the local and domain accout desn'tmean Windows would use it. I would even consider such a behavior a significant security hole.


I agree it's a Security Hole, but I disagree that it won't use it. I've been able to use that "loop-hole" for many years on every OS Microsoft puts out including Server 2003. Now VISTA may have finally done something about it but not sure.

Stupid, Stupid on MS part to allow that to happen but it does.
Correctly coding and using tools or methods appropriate would be better though.

Top
#181804 - 2007-10-21 04:10 AM Re: Mapping drives using remote credentials [Re: NTDOC]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I stand corrected. I did not realize that Windows would be able to utilize the same password even though you're using a different SID.
_________________________
There are two types of vessels, submarines and targets.

Top
#181805 - 2007-10-21 09:37 AM Re: Mapping drives using remote credentials [Re: Sealeopard]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I thought the only things a user need to provide are:
  • User name
  • Password

If these match, access is granted.
I don't think there is a security hole. I think it is just about the way the system is (ab)used by users and administrators.
I think we should just stop creating local user accounts (OK, maybe one alternate local Admin with password only known by the IT Admin team). If users need to log on disconnected from the domain, I see (almost) no problem using the cached user profile.
Maybe it would be better to tell why a user or an administrator thinks he needs a local user and evaluate if it can be done with a domain user.

What I don't know is if the InGroup() will work. But I think one should use a domain user ID to evaluate membership of domain groups! That logon script should only run if using a domain user name and if connected to the domain. And AFAIK that is just the way the legacy logon script and the GPO Startup/Shutdown Logon/Logoff scripts work.

Top
#181806 - 2007-10-22 04:52 AM Re: Mapping drives using remote credentials [Re: Witto]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
 Originally Posted By: Witto

I don't think there is a security hole. I think it is just about the way the system is (ab)used by users and administrators.


Well if it were Windows 3.1 days maybe but in the days of Networking and NT and MS spent tons of time and money to get C2 security approved (only when disconnected from a network) then I find it very unacceptable that 2 different machines sitting in different work groups can connect to each other as an Administrator by sharing any name and password. It's not a wimpy Website, it's supposed to be a secure workstation or server (they both allow it) that's why they have so many features designed for security to keep others out.

In a Login script the Ingroup is going to use the Domain by default it you don't preface it with a local workstation name.

Please provide with greater detail what it is you want to accomplish and show your current script and we can probably assist you better.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1077 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.066 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org