sasifras
(Fresh Scripter)
2002-09-23 11:00 PM
Drive Mappings - XP, etc

I'm a bit confused. I've been lurking around this board for a week or so trying to find out how to deal with this on my own and can't seem to find the right answer. I have a test bed, 1 DC (2K) and a bunch of workstations (XP only). I've installed Kix on the DC and added the needing things the AD section to kick off the script. When I try and login, first it takes forever (20-35 seconds versus non-script logins of 1-2 seconds). Second, my objective (drive mappings) don't work. I tried to add a tad of code to display this information better for me to see what was going on but the jist of it is that the INGROUP doesn't seem to understand the groups the user is really a part of.

User: X1
Groups In: Test1, Test2, and Test3

Script:
code:
;Make the window appear
IF @dos = 5.0
$HKLMS = 'HKEY_LOCAL_MACHINE\SOFTWARE'
IF 1 <> ReadValue($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon",
"RunLogonScriptSync")
$ = WriteValue ($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlog
on", "RunLogonScriptSync", "1", "REG_DWORD")
ENDIF
ENDIF


;Clear all possible network drive mappings

use M: /d
use N: /d
use O: /d
use P: /d
use Q: /d
use R: /d
use S: /d
use T: /d
use U: /d
use V: /d
use W: /d
use X: /d
use Y: /d
use Z: /d

IF InGroup("Test1")
? "Mapping X:"
use X: \\dusty\1
If @error = 0
? " Mapping of drive X Successful"
ELSE
? " Error mapping drive X to \\Dusty\1"
ENDIF
ELSE
? " Not in Test1"
ENDIF

IF InGroup("Test2")
? "Mapping X:"
use Y: \\dusty\2
If @error = 0
? " Mapping of drive Y Successful"
ELSE
? " Error mapping drive Y to \\Dusty\2"
ENDIF
ELSE
? " Not in Test2"
ENDIF
IF InGroup("Test3")
? "Mapping Z:"
use Z: \\dusty\3
If @error = 0
? " Mapping of drive Z Successful"
ELSE
? " Error mapping drive Z to \\Dusty\3"
ENDIF
ELSE
? " Not in Test3"
ENDIF

Color y+/n
At (23,32) "<any key to continue>"
Get $x

What I end up with is Not in Test1, etc etc for all the groups when the user IS in those groups. Also, I tried running the kix.kix that came with kixtart (sample) to see what groups the user was supposed to be in and even that doesn't show the right memberships - but I can manually map a drive which could only be done if this user was in that group! I am logging into the DC and I'm not sure what else to do. HELP!


Sealeopard
(KiX Master)
2002-09-24 12:45 AM
Re: Drive Mappings - XP, etc

Instead of deleting each drive separately, you can do
code:
use * /delete

Secondly, by default, only local administrators can write to HKEY_LOCAL_MACHINE.


sasifras
(Fresh Scripter)
2002-09-24 01:17 AM
Re: Drive Mappings - XP, etc

I only want to delete certain drives - the rest are in 'user definable' space for non-standard things...

In terms of the reg-hack, you are implying that I need to run this with boosted rights or ensure each user who logs in has local admin rights - correct?


Sealeopard
(KiX Master)
2002-09-24 01:37 AM
Re: Drive Mappings - XP, etc

If you want to make changes to HKEY_LOCAL_MACHINE under Windows NT/2000/XP, then most likely administrative privileges will be required. However, you can also specify RunLoginScriptSync on a per-user level by writing to HKEY_CURRENT_USEr or implement it via GPO if you have an AD domain.

Les
(KiX Master)
2002-09-24 03:58 AM
Re: Drive Mappings - XP, etc

If testing newly created groups then you may be fighting the group membership cache.

YOu may want to start with well known groups or launch KiX with the /F option.


sasifras
(Fresh Scripter)
2002-09-25 12:58 AM
Re: Drive Mappings - XP, etc

I am starting kixtart with the /f option already. These groups are at least 2 weeks old now. What I don't understand is why when I run the kix.kix sample (which will display group membership) it only shows the LOCAL groups - nothing from the domain and I'm logging into the domain???

Les
(KiX Master)
2002-09-25 02:45 AM
Re: Drive Mappings - XP, etc

Do you get the same results with an admin account? Anything in the kixtart.log?

I'm thinking you may have an AD permission issue.


sasifras
(Fresh Scripter)
2002-09-25 11:26 PM
Re: Drive Mappings - XP, etc

Well... I tried logging in as the Admin on an XP machine (domain admin) who I've added the login script to in AD. It still takes forever to apply the personal settings (30+ seconds when the script is active) and then it still didn't work...

sasifras
(Fresh Scripter)
2002-09-27 10:32 PM
Re: Drive Mappings - XP, etc

Ok...I'm totally stuck. I know the problem is that when I run INGROUP it doesn't correctly see what group(s) the users are in...but why?!?! If I can't get this working soon I'll have to bag this whole idea and try something down another path [Frown]

LonkeroAdministrator
(KiX Master Guru)
2002-09-27 11:04 PM
Re: Drive Mappings - XP, etc

this is getting nice...

questions:
what kix version?
what is the OS?
 


sasifras
(Fresh Scripter)
2002-09-27 11:36 PM
Re: Drive Mappings - XP, etc

kix ver 4.11
OS Win2K Server, PC's all XP - pure AD


Howard Bullock
(KiX Supporter)
2002-09-27 11:43 PM
Re: Drive Mappings - XP, etc

Did you create "GLOBAL" groups or "Domain Local" groups in the domain?

sasifras
(Fresh Scripter)
2002-09-27 11:45 PM
Re: Drive Mappings - XP, etc

Global in most cases. On the production setup they'll all be Universal though

BrianTX
(Korg Regular)
2002-09-27 11:46 PM
Re: Drive Mappings - XP, etc

Something's not quite making sense here.. A 30 second delay sounds like an issue with how it's being processed across the network. As such, have you tried copying the script locally and running it? (A local copy of kixtart would be nice, too)

Brian

[ 27. September 2002, 23:48: Message edited by: BrianTX ]


Howard Bullock
(KiX Supporter)
2002-09-27 11:52 PM
Re: Drive Mappings - XP, etc

Domain local groups are not visible to member servers or workstations until the domain is running in native mode. I do not have any experience with native mode, domain local groups, and KiXtart at this time.

Check the registry on a client computer. Does this key (HKEY_CURRENT_USER\Software\KiXtart\TokenCache) exist?

code:
if ingroup("GlobalGroupName")
? "In the group"
else
? "NOT in the group"
endif

Execute the code in a DOS window. What is the result? Note that If you make change to a group you will have to logoff and logon before testing. This is because INGROUP reads the Global Group membership from the security token of the user and does not check the domain DC.
Write a simple test script that references a global group.

[ 27. September 2002, 23:53: Message edited by: Howard Bullock ]


kholm
(Korg Regular)
2002-09-27 11:58 PM
Re: Drive Mappings - XP, etc

You have to delete 'persistent' connections as well when you disconnect drives:
code:
If InGroup("Test1")
? "Mapping X:"
Use X: /Delete /Persistent
Use X: "\\dusty\1"
If @Error = 0
? " Mapping of drive X: Successful"
Else
? " Error mapping drive X: to \\dusty\1"
EndIf
Else
? " Not in Test1"
EndIf

/Persistent along with /Delete is the keyword

-Erik


sasifras
(Fresh Scripter)
2002-09-28 12:30 AM
Re: Drive Mappings - XP, etc

Let me try and answer all of the new troubleshooting questions:

Delete the persistant connections first: I've done that, check out the top of the script. I don't do a * becuase I need to only remove certain letters and I never map outside of those I've deleted. I'm not sure why the /persistant would apply to the /delete but I can try it if you think it'd help (the real issue here is the INGROUP - that I've been able to determine).

Check the registry on a client computer. Does this key (HKEY_CURRENT_USER\Software\KiXtart\TokenCache) exist?

Yes - with all the different users I've tried in it.

Using your code sample would be just like using mine without the mapping statement, right? Regardless, it goes to the ELSE section for all groups tested against.

Running the script locally: Yes, I tried, the script runs rather slowly locally as well. In debug mode, it hangs for 5-15 seconds on the first INGROUP and then processes normally beyond that. The results still aren't what I want, but that is what I think is causing the speed issue - some bad lookup somehow/somewhere.

Thanks for all the new ideas...


Les
(KiX Master)
2002-09-28 01:31 AM
Re: Drive Mappings - XP, etc

Check your event log and the KiXtart.log file for errors. I still have a feeling it's an AD perms issue.

Barring that, check for extra protocols. Also check for binding order and provider order.


Sverre
(Getting the hang of it)
2002-09-30 12:57 AM
Re: Drive Mappings - XP, etc

I have heard that Xp machines tend to run wery slow on networks. I experience the same thing myself, XP machines more than 30 secs, W2K machines less than 5 secs to run login script.

Fernando Madruga
(Starting to like KiXtart)
2002-09-29 03:50 PM
Re: Drive Mappings - XP, etc

Actually, if MSFT did what they claim to, XP will "appear" to run logon scripts slower than W2K machines... They say that, in order to boost boot up time, you can get to a "press ctl-alt-del prompt" BEFORE the network is fully initialized. Problem is, when you "need" the network in order to run scripts and perform AD lookups or such, you'll have to wait for the network components of XP to be fully operational.
Don't know if this may help, but you could try setting up a W2K Pro machine, run some tests on it, then upgrade it to WXP and run the same tests.


LonkeroAdministrator
(KiX Master Guru)
2002-09-29 04:49 PM
Re: Drive Mappings - XP, etc

another way to check on that slowness could be to boot up the machine and leave it alone for 5 mins or so.

this was the method to log on faster with nt-server...
 


sasifras
(Fresh Scripter)
2002-09-29 09:01 PM
Re: Drive Mappings - XP, etc

All of my times are from the CTRL-ALT-DEL screen in and the machine has been booted for several hours sometimes at this point.

LonkeroAdministrator
(KiX Master Guru)
2002-09-29 09:17 PM
Re: Drive Mappings - XP, etc

I don't know about ad-domain, but in our nt-domain haven't heard anything similar...

Chris Jorgan
(Fresh Scripter)
2002-09-30 03:33 AM
Re: Drive Mappings - XP, etc

I believe I know your problem, as I had similar problems with my network. Whenever I tried to execute the login script from clients, it wouldn't locate the groups I had mentioned for my drive mappings. What I did to fix the problem was mention the domain name along with the group name, as I think the clients were attempting to look locally for the groups. Here's an example:

If InGroup ("DOMAINNAMEHERE\Domain Users")
Use K: "FILE SERVER\FILESHARE"
Endif

So if your domain name is Yahoo (which I'm pretty sure it isn't :-)), it would look something like this:
If InGroup ("Yahoo\Domain Users")
Use K: "FILE SERVER\FILESHARE"
Endif

Let me know if I helped, as I'm also a beginner with very little experience with programming/coding, so I would feel great to know that I helped someone else out instead of everyone just helping me.

Good luck


Fernando Madruga
(Starting to like KiXtart)
2002-09-30 04:22 AM
Re: Drive Mappings - XP, etc

Are you hiding from someone, guy54321? Zero personal info, not even your first/last names... Not even a signature! Some people, like myself, tend to ignore those who want to stay in the shadows... This is just an opportunity to make you "see the light"... [Smile]

[ 30. September 2002, 04:22: Message edited by: Fernando Madruga ]


sasifras
(Fresh Scripter)
2002-09-30 10:53 PM
Re: Drive Mappings - XP, etc

Tried the FQ as well... IF INGROUP("REMOTE\Test1") and that doesn't work either.

BrianTX
(Korg Regular)
2002-09-30 11:32 PM
Re: Drive Mappings - XP, etc

Hmm. well, there are WMI alternatives to INGROUP... especially with ADSI.. interested?
Start browsing the COM section of the bulletin board.

Brian

P.S. There are a few scripts floating around that use "NET USER" commands to enumerate local or domain groups, I believe.


LonkeroAdministrator
(KiX Master Guru)
2002-09-30 11:49 PM
Re: Drive Mappings - XP, etc

still, if it's not working, I believe there is error somewhere else...

so, mostlikely the com-solutions will not work either.
 


BrianTX
(Korg Regular)
2002-09-30 11:56 PM
Re: Drive Mappings - XP, etc

You're write, jooel, however it gives an alternate means of testing: If you sit at a machine and do a "net user %username% /domain", it should tell you what domain groups the user belongs to. If that is functioning properly, then it's possible to get to the information.. if not then there are other issues.

Brian


sasifras
(Fresh Scripter)
2002-10-01 12:07 AM
Re: Drive Mappings - XP, etc

I'll give the COM stuff a go once I figure it out...

Sealeopard
(KiX Master)
2002-10-01 03:01 PM
Re: Drive Mappings - XP, etc

Are you running WINS? We're getting reports that WINS seems to be required for INGROUP to work. See WINS and XP .

[ 01. October 2002, 15:08: Message edited by: sealeopard ]


sasifras
(Fresh Scripter)
2002-10-01 11:59 PM
Re: Drive Mappings - XP, etc

Although it is a very short topic...very interesting. I didn't setup WINS in this environment because it is so small although it is in the production env. I will try that before I delve into the COM stuff.

sasifras
(Fresh Scripter)
2002-10-02 01:21 AM
Re: Drive Mappings - XP, etc

Tried the WINS thing, still doesn't work. Guess I'm off on the COM stuff.

Howard Bullock
(KiX Supporter)
2002-10-02 01:33 AM
Re: Drive Mappings - XP, etc

Can you log on to the domain controller and execute a simple INGROUP script in a DOS window to see if your current account is in the "Domain Users" group? What is the result?

sasifras
(Fresh Scripter)
2002-10-02 03:58 AM
Re: Drive Mappings - XP, etc

I'm lost...On the DC, I can do an INGROUP for normal groups (Domain users, admins, etc) but none of the groups I setup under other OU's. On the PC, I can't get INGROUPs to work for ANY groups on the DC, even if I put in the domain name.

Howard Bullock
(KiX Supporter)
2002-10-02 04:10 AM
Re: Drive Mappings - XP, etc

Let's just focus on working with the DC for now. First this is a W2K active directory domain controller, right?

When you created your groups, did you create Group Scope = "Global" + Group Type = "Security" or did you use some other combination?


surfkat
(Fresh Scripter)
2002-10-02 10:38 AM
Re: Drive Mappings - XP, etc

Just had a quick read through the messages.

What version of XP are you using on the clients? I do not think XP Home is good for Networks. MS do not recommend it for business use, specially AD environments.

I have a mixed environment and INGROUP works fine. Did you try a Windows 2000 machine yet?


Sealeopard
(KiX Master)
2002-10-02 02:59 PM
Re: Drive Mappings - XP, etc

IIRC, Windows XP Home cannot even connect to a domain, thus he must be talking about Windows XP Professional. I also believe that Windows XP Home is limited to a five-node peer-to-peer network, too.

Also, I think we might have to ask Ruud for advice about the INGROUP functionality. I have not yet seem any specific statement that INGROUP is fully AD compliant.

[ 02. October 2002, 15:02: Message edited by: sealeopard ]


sasifras
(Fresh Scripter)
2002-10-02 10:37 PM
Re: Drive Mappings - XP, etc

All machines are XP Pro (not home, they don't work outside of P2P). I have 1 W2K machine I could possibly test on, although production must use XP so it'd be a sanity check thing.

W2K Server, native AD structure.

Groups are all created as - Global / Security (production groups are all Universal / Security, but in this environment, Global is what they would have to be)

Most groups are created under other OU's outside of the normal OU's. Strangly, this seems to be a common point of issue until I try to move one of these groups into the normal OU for groups (where the DU and DA's are at) and it still doesn't work.

The big thing for me is that when you run the kix.kix script that comes in the sample directory on the 2nd or 3rd page where it lists all groups user is in, it ONLY lists system-created groups. Lastly, my groups look the same (Global/Security) as the syscreated groups.

I thought ingroup was AD compliant...maybe I missed something.


LonkeroAdministrator
(KiX Master Guru)
2002-10-02 11:25 PM
Re: Drive Mappings - XP, etc

ingroup is ad compliant for sure, but might be that some little difference in your env explouds everything...
 


Sealeopard
(KiX Master)
2002-10-02 11:29 PM
Re: Drive Mappings - XP, etc

Have you tried Brian's option of running
code:
net user %username% /domain

at the command prompt? If this doesn't give correct results either then it's most likely not a KiXtart issue in itself.


sasifras
(Fresh Scripter)
2002-10-03 10:45 PM
Re: Drive Mappings - XP, etc

C:\Documents and Settings\x1>net user %username% /domain
The request will be processed at a domain controller for domain remote.mydomain.com.

System error 1355 has occurred.

The specified domain either does not exist or could not be contacted.

Well well... that's not good. I can ping the DC, so I know that's in order and I never see a failed to login msg. Also, I can map drives manually off the DC - so what the heck is wrong?


Sealeopard
(KiX Master)
2002-10-03 11:00 PM
Re: Drive Mappings - XP, etc

At least we now don't have to worry about something being broken in KiXtart.

I just had a similar problem during a contract job. there were a lot of problems with the AD, for example I couldn't install a second domain controller because of a 'domain not found' problem. There were also authentication problems.

However, after checking the domain trust, I found that the domain was set up for a two-way trust with itself. Removing this solved the problem. And just in case you wonder, that company had the systems administrator fired after a couple of months on the job. I'm just there to fix stuff ;-)

[ 03. October 2002, 23:01: Message edited by: sealeopard ]


BrianTX
(Korg Regular)
2002-10-04 03:11 PM
Re: Drive Mappings - XP, etc

I don't know if this is your issue, but a similar error message is obtained regarding missing sysvol shares... Here is the article from Microsoft:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q283133

Brian


jbastete
(Fresh Scripter)
2002-10-31 08:01 AM
Re: Drive Mappings - XP, etc

I am also having the same issue. When my XP pc logon and they do not get any mapped drives. We are in a 2k domain with AD. We use the Ingroup function also and in our .bat file that calls the script we use the %0\..\ scriptname.kix. We are about to rollout XP and just found this issue. Help!!!

LonkeroAdministrator
(KiX Master Guru)
2002-10-31 08:05 AM
Re: Drive Mappings - XP, etc

j, don't see that this in any way related.
anyway, try calling your logonscript without the %0\..\ and xp should work just fine.

in logonbatch with nt/w2k/xp the correct/recommended way to call kix:
kix32 script.kix

and for win9x:
z:\kix32 z:\script.kix

the %0\..\ basically is just a workaround for compining those.
as the %0 does not work correctly in xp, the recommend way is recommended (how that sounded so stupid...)

cheers.


jbastete
(Fresh Scripter)
2002-10-31 08:26 AM
Re: Drive Mappings - XP, etc

Thanks I will try that tomorrow. Also for the issue with the 1355 error, try to remove the computer from the domain and then add it back. If that does not work I would check your FSMO roles and make sure that you can contact the PDC emulator. It is usually the first DC that was upgraded to Windows 2k but it can be changed.

I will check back tomorrow to see if my suggestion help. Thank all.


jbastete
(Fresh Scripter)
2002-10-31 08:06 PM
Re: Drive Mappings - XP, etc

Still not getting anything from my login script. My .bat file is below:

echo off
Rem Detect OS (NT or other)
if (%OS%) == (Windows_NT) goto NT_XP

:9x
%0\..\kix32.exe jastete.kix
goto end

:NT_XP
kix32.exe jastete.kix
:end
EXIT

I see the winodow minimized and wait for the login script to complete but I do not get any drives. What am I doing wrong? I am pretty good at kix I thought but I guess not???


Sealeopard
(KiX Master)
2002-10-31 08:38 PM
Re: Drive Mappings - XP, etc

For starters, you could read the FAQ Forum, display the login window not minimized, and run a very simple KiXtart script that for example just displays a messagebox. Then you add code piece by piece and verify that it works by using either DEBUG ON and/or @ERROR evaluations.