Page 1 of 1 1
Topic Options
#211993 - 2016-10-05 07:01 PM 2012 Logon Script
carpacheco Offline
Fresh Scripter

Registered: 2016-08-05
Posts: 5
Loc: Florida
Hi, I am having problems running kixstart to map drives. I set debug on my script and I can see the script running with no errors however my drives dont map. This works in 2008 servers but not in 2012. I am using 4.66

 Code:
@ECHO OFF
%0\..\KIX32.exe /f %0\..\file.kix


Kik Fie:
 Code:
IF INGROUP (Test_Users)
	uSE p: /DELETE /PERSISTENT
	USE p: "\\"My server"\USERS$\@USERID" /PERSISTENT
	
ENDIF


Edited by Mart (2016-10-06 09:03 AM)
Edit Reason: Added code tags

Top
#211994 - 2016-10-05 07:03 PM Re: 2012 Logon Script [Re: carpacheco]
carpacheco Offline
Fresh Scripter

Registered: 2016-08-05
Posts: 5
Loc: Florida
by the way if I use the profile Logon field to specify kixstart in AD it works. But not if I use a logon GPO to launch the kixstart script.
Top
#211996 - 2016-10-05 10:24 PM Re: 2012 Logon Script [Re: carpacheco]
Glenn Barnas Administrator Online   content
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
GPO based doesn't run in a user context and isn't really recommended - user profile is the way to go - fastest, too.

Your Use syntax doesn't look right - try this:
 Code:
$Map = '\\My Server\Users\' + @USERID
Use P: $Map /PERSISTENT
You have too many quotes in your example. Also - you should not place variables or macros inside of strings - leads to many problems.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#212009 - 2016-10-07 02:13 AM Re: 2012 Logon Script [Re: Glenn Barnas]
carpacheco Offline
Fresh Scripter

Registered: 2016-08-05
Posts: 5
Loc: Florida
the results are the same no mapping. however if I add a explorer command at end of script it works.
???

$Map = '\\My Server\Users\' + @USERID
Use P: $Map /PERSISTENT
explorer

Top
#212013 - 2016-10-07 10:02 PM Re: 2012 Logon Script [Re: carpacheco]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Does it Really work? Or explorer just being launched under the same context, that the drives are being mapped with, so it looks like it works? Are the drives still there after the login process is complete, and you close and re-open explorer? Does it provide any errors when it doesnt work?
Top
#212014 - 2016-10-08 01:31 PM Re: 2012 Logon Script [Re: ShaneEP]
Glenn Barnas Administrator Online   content
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
If you download my Universal Login Script and configure one user to run it as follows - "kix32.exe kixtart.kix --d" - it will run in debug mode. The script will dump a ton of diagnostic information into the LoginDebug.log file in the users profile directory. See the log example below. (I removed all but two of the drive mappings to keep it short.)

This debug information has led to solving odd problems such as what you are seeing on several occasions. The script is free for use in environments with up to 4 domain controllers. If your environment is larger than that, PM me and I'll get you a 30-day trial key for use in diagnosing the issue. I can also assist with creating a simple configuration file for the one share for testing.

If the script encounters errors during the mapping operation, they will be reported in the "loginerrs.log" file, also in the user's profile folder (%USERPROFILE%).

One question - why are you mapping the user's home folder? This is done automatically by AD if defined in the user profile, and manual mapping often results in incorrect permissions on the home folder. My ULS, in fact, uses a "HOME" parameter and will ignore the mapping when run during a logon session, but will look up the UNC and map it if executed after the logon.

One FYI about the log below - there are two UNCs defined for G: - this is correct as the script uses that as a D/R link - it maps to the first UNC and if the connection times out, it maps to the second.

Good luck!

Glenn

 Code:
Licensed
UserProcess.kix has been loaded and is active.
NAC Checking is ENABLED.
=========================================================
2016/09/28  -  06:52:40
          Kixtart: 4.66
          Version: 2.8.7b_ts
         INI File: C:\Users\gbarnas\AppData\Local\Temp\login.ini (cached)
             User: Barnas, Glenn A. / gbarnas
Locale / Language: 1033 / English (United States)
      LoginServer: \\IHWIADCP02
           Domain: ITCG
       User OU DN: OU=Employees,OU=User Accounts - Regular,OU=Users,OU=Headquarters,DC=itcg,DC=pvt
   User OU Offset: 1
          User OU: User Accounts - Regular
  Wkstn OU Offset: 0
      Wkstn OU DN: OU=Desktop,OU=Workstations,OU=Computers,OU=Headquarters,DC=itcg,DC=pvt
         Wkstn OU: Desktop
       Logon Mode: 1
           Laptop: 0
     Detected O/S: Windows 10 Pro / Version 10.0
        Privelege: USER
  Local Privelege: User
        ScriptDir: C:\Windows\system32 / C:\Windows\system32
         StartDir: \\Ihwiadcp02\netlogon
     User Process: 1
     Session Type: Console
      LP Hard Map: 0
      Debug Level: 1

 Group Membership: 
                    Domain Users
                    Everyone
                    Users
                    Remote Desktop Users
                    INTERACTIVE
                    CONSOLE LOGON
                    Authenticated Users
                    This Organization
                    LOCAL
                    OG-Development Team
                    OG-Web Admins
                    AC-Unrestricted Web
                    OG-Principals
                    AC-RD Access - All
                    OG-Technical Services Team
                    AC-RD Access - Dev
                    LG-HQ Users
                    AC-VPN Users
                    AC-RD Access - Farm 2
                    AC-RD Access - Farm 1
                    Authentication authority asserted identity
                    RC-Accounting
                    PR-NP03
                    RC-ITCG Internal
                    RC-ITCG
                    RC-Multimedia
                    RC-Multimedia-II
                    RC-Development
                    RC-MSDN
                    RC-Backup
                    PR-NP01
                    RC-eBooks
                    RC-Development-Kix
                    RC-Development-Internal
                    RC-SWDist
                    RC-WebShare
                    Medium Mandatory Level
                    Users
                    

 - ENVIRONMENT START - 
ALLUSERSPROFILE=C:\ProgramData
APPDATA=\\ihwifpsp01\Profiles$\gbarnas\AppData\Roaming
CommonProgramFiles=C:\Program Files (x86)\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=IHWD021
ComSpec=C:\Windows\system32\cmd.exe
HOMEDRIVE=H:
HOMEPATH=\
HOMESHARE=\\ihwifpsp01\Users\gbarnas
KIXLIBPATH=K:\kixlib;K:\kixlib\_private
KWORKDIR=c:\KRMMWork\
LOCALAPPDATA=C:\Users\gbarnas\AppData\Local
LOGONSERVER=\\IHWIADCP02
NUMBER_OF_PROCESSORS=8
OS=Windows_NT
Path=\\IHWIADCP02\NETLOGON;c:\KRMMWork\Bin;C:\PROGRA~2\ITCG\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.KIX;.KX;.KXW;.KW
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_ARCHITEW6432=AMD64
PROCESSOR_IDENTIFIER=AMD64 Family 21 Model 2 Stepping 0, AuthenticAMD
PROCESSOR_LEVEL=21
PROCESSOR_REVISION=0200
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files (x86)
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$CIHWD021$F - $P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SEE_MASK_NOZONECHECKS=1
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
S_BIN=C:\PROGRA~2\ITCG\bin
S_CONFIG=C:\PROGRA~2\ITCG
S_LIB=C:\PROGRA~2\ITCG\Lib
S_LOGS=C:\PROGRA~2\ITCG\Logs
TEMP=C:\Users\gbarnas\AppData\Local\Temp
TMP=C:\Users\gbarnas\AppData\Local\Temp
UNISON=C:\PROGRA~2\ITCG\Unison
USERDNSDOMAIN=ITCG.PVT
USERDOMAIN=ITCG
USERDOMAIN_ROAMINGPROFILE=ITCG
USERNAME=gbarnas
USERPROFILE=C:\Users\gbarnas
windir=C:\Windows
 - ENVIRONMENT END - 



Processing DATA_CORP (DISK)
 Eval: 1, Man: 0, IM: 0, IA: 0, Chk: 1
  Member of allowed group RC-ITCG - continuing.
 Logic: AND, Value: 3, Required: 3
    OK to process this resource!
 PATH Translated: \\ihwifpsp01\itcg;\\ihwifpsp02\itcg
 DESC Translated: Shared Data


Processing SWDIST (DISK)
 Eval: 1, Man: 0, IM: 0, IA: 0, Chk: 1
  Member of allowed group RC-SWDist - continuing.
 Eval: 0, Man: 0, IM: 0, IA: 0, Chk: 0
  No match in allowed group AC-Workstation Admins - ignored.
 Eval: 0, Man: 0, IM: 0, IA: 0, Chk: 0
  No match in allowed group AC-Server Admins - ignored.
 Eval: 0, Man: 0, IM: 0, IA: 0, Chk: 0
  No match in allowed group Domain Admins - ignored.
 Logic: AND, Value: 3, Required: 3
    OK to process this resource!
 PATH Translated: \\ihwifpsp01\SWDIST
 DESC Translated: SWDIST Install Point


Processing MOTD_General (MESSAGE)
    OK to process this resource!
 PATH Translated: \\ihwifpsp01\Users\MOTD.txt
 DESC Translated: Message of the day


Processing MOTD_Admins (MESSAGE)
  requires ADMIN privilege - skipping.


Processing HP4350PCL (PRINT)
 Eval: 1, Man: 0, IM: 0, IA: 0, Chk: 1
  Member of allowed group PR-NP01 - continuing.
 Logic: AND, Value: 3, Required: 3
    OK to process this resource!
 PATH Translated: \\ihwifpsp01\ihphpm01
    New - Slot 0: HP4350PCL


Processing BR6710 (PRINT)
 Eval: 1, Man: 0, IM: 0, IA: 0, Chk: 1
  Member of allowed group PR-NP03 - continuing.
 Logic: AND, Value: 3, Required: 3
    OK to process this resource!
 PATH Translated: \\ihwifpsp01\ihpbrc01
    New - Slot 1: BR6710


Processing active resources:
   Disk: G	\\ihwifpsp01\itcg;\\ihwifpsp02\itcg
   Disk: Y	\\ihwifpsp01\SWDIST
Printer: 	\\ihwifpsp01\ihphpm01	S
		SoftMap - Exists
		Pre-existing default
Printer: 	\\ihwifpsp01\ihpbrc01	N
		SoftMap - Exists
Message: 	\\ihwifpsp01\Users\MOTD.txt  [0.1]
_________________________
Actually I am a Rocket Scientist! \:D

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 1202 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.054 seconds in which 0.024 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