#110945 - 2003-12-27 11:44 PM
INGROUP failing with SBS2003
|
Ashpoint
Starting to like KiXtart
Registered: 1999-08-27
Posts: 192
Loc: Sydney, NSW, Australia
|
I'm porting a long standing login script to a new SBS2003 and seeing strange happenings with a tried and trusted script.
IF INGROUP("Private") fails with a message "Unknown Command [Private]"
PRIVATE, EXECS and SBT have been created in the Security Groups in the Active Directory.
If I bypass that line, I get similar failings with any other INGROUP command such as...
IF INGROUP("Execs") and IF INGROUP("SBT") etc
I changed Kix to the latest download. Removed KXPRC.EXE and reinstalled it.
Stopped and restarted the service.
It's almost as if the system is ignoring the Quotes.
Can anyone throw light on the issue?
|
|
Top
|
|
|
|
#110949 - 2003-12-28 07:50 AM
Re: INGROUP failing with SBS2003
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
First of all..
What version of KiXtart are you running? If the script works on other OS Platforms, you should consider being on at least 4.21 (if Memory serves) or better..
You have in your script - IF INGROUP("Execs") ...
Do you have any other domains? If so, you may need to precede the group check with -
IF INGROUP("DOMAINA\Execs") ...
As Les suggested, you are probably missing a quote. As Doc suggested KiXStrip will parse and then point out where the code is having the problem. Again, if you post your complete code, this may also help too.
Kent
|
|
Top
|
|
|
|
#110950 - 2003-12-28 09:40 AM
Re: INGROUP failing with SBS2003
|
Ashpoint
Starting to like KiXtart
Registered: 1999-08-27
Posts: 192
Loc: Sydney, NSW, Australia
|
Thank you all VERY much for responding.
I'm now running the current version of Kix422 which I downloaded from the board yesterday.
I'm running the code on a single domain. (SBS only allows one domain).
I have run the code in DEBUG mode. Presently I have stripped all the INGROUPs for testing and as soon as the code gets to the area where I map drives (See the code), the code exits and returns me to the OS.
I've run the code through MCA's Kixstrip (Thanks also MCA for making the tool available). There were no errors found.
Here's the code...
I really appreciate all the comments. As I said before, this code has been running trouble free for several years on a WinNT server.
Code:
;============================================================
; KIXTART.KIX
;
; By Michael Rychter - For JGBS
;
; First created on 21 December 1999
; Revised: 22/07/2000 MR - For JGBS
; Revised: 20/01/2002 MR - To include McAfee update
; Revised: 27/01/2002 SF - Rebuilt server \\FRED to new name \\SERVER
; Revised: 27/12/2003 MR - Rebuilt for new SBS server
;=======================================================================
SETTIME "\\FRED"
;debug on
$HKCUExplorer = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
$HKCUSystem = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System"
$McAfeeRegKey = "HKEY_LOCAL_MACHINE\Software\Network Associates\TVD\Shared Components\On Access Scanner\Vshield\System Scan\General"
$McAfeeDlSite = "HKEY_LOCAL_MACHINE\Software\Network Associates\TVD\Shared Components\McUpdate\CurrentVersion\Update\Update Site1"
$McAfeeVer = "HKEY_LOCAL_MACHINE\Software\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx"
$McAfeeExe = "C:\Program Files\Common Files\Network Associates\McUpdate\McUpdate.exe"
$SysPath = "C:\Windows\System\"
$Cr = CHR(13) + CHR(10)
$Cr2 = $Cr + $Cr
$UserId=@userid
$HomeServer="FRED"
$ScriptsDrive="L:"
$ScriptsShare="\\$HomeServer\NETLOGON"
$NetWorkDrive="N:"
$NetWorkShare="\\$HomeServer\NetWork$"
$McAfeeDrive="M:"
$McAfeeShare="\\$HomeServer\McAfee$"
$PrivateDrive="P:"
$PrivateShare="\\$HomeServer\Private$"
$SBTDrive="H:"
$SBTShare="\\$HomeServer\SBT$"
$PayrollDrive="W:"
$PayrollShare="\\$HomeServer\Payroll$"
$CDROMDrive= "S:"
$CDROMShare="\\$HomeServer\CDROM"
$IDRDrive= "I:"
$IDRShare="\\$Homeserver\IDR$"
$ExecsDrive="X:"
$ExecsShare="\\$Homeserver\Execs$"
$UserDrive= "U:"
$UserShare= "\\$HomeServer\$UserId$"
;;;; Code exits to OS about here
USE $IDRDrive /DELETE
USE $ExecsDrive /DELETE
USE $NetWorkDrive /DELETE
USE $PrivateDrive /DELETE
USE $ScriptsDrive /DELETE
USE $SBTDrive /DELETE
USE $PayrollDrive /DELETE
USE $UserDrive /DELETE
USE $McAfeeDrive /DELETE
USE $CDROMDrive /DELETE
USE $UserDrive $UserShare
USE $CDROMDrive $CDROMShare
USE $NetWorkDrive $NetWorkShare
IF INGROUP("SBT")
USE $SBTDrive $SBTShare
ENDIF
IF INGROUP("Domain Admins")
USE $ScriptsDrive $ScriptsShare
ENDIF
IF INGROUP("Private")
USE $PrivateDrive $PrivateShare
ENDIF
;================= Secure Backup Exec Data Recovery Files ============
IF INGROUP("Execs")
USE $ExecsDrive $ExecsShare
USE $IDRDrive $IDRShare
COPY "I:\FRED.dr" "C:\FRED.dr"
USE $IDRDrive /DELETE
ENDIF
;=================== Message Screen ===================================
$message = "Welcome @FULLNAME. You have been sucessfully authenticated" + CHR(13)
+ "on the @LDOMAIN System by the server called @LSERVER."
+ CHR(13) + CHR(13)
+ "Your Workstation time has been set to @TIME" + CHR(13) + CHR(13)
+ "You are currently logged onto @WKSTA as @USERID with the following" + chr(13)
+ "drive mappings:" + CHR(13) + CHR(13)
+ "$UserDrive $UserShare" + CHR(13)
+ "$CDROMDrive $CDROMShare" + CHR(13)
+ "$NetworkDrive $NetworkShare" + CHR(13)
IF INGROUP("Private")
$message = $message + "$PrivateDrive $PrivateShare" + CHR(13)
ENDIF
IF INGROUP("Execs")
$message = $message + "$ExecsDrive $ExecsShare" + CHR(13)
ENDIF
IF INGROUP("Domain Admins")
$message = $message + "$ScriptsDrive $ScriptsShare" + CHR(13)
ENDIF
;=================== McAfee Splash Screen & Virus Update ================
USE $McAfeeDrive $McAfeeShare
$RK= KeyExist($McAfeeRegKey)
IF @ERROR = 0
$RKVal = ReadValue($McAfeeRegKey,"bSkipSplash")
IF $RKVal = "0"
WriteValue($McAfeeRegKey, "bSkipSplash","1","REG_DWORD")
ENDIF
ENDIF
$McAfeeSVersion = ReadProfileString($McAfeeDrive + "\Updates\Delta.ini", "Contents", "CurrentVersion")
$McAfeeWVersion = SUBSTR(ReadValue($McAfeeVer,"szDatVersion"),5,4)
IF $McAfeeSVersion <> $McAfeeWVersion
$RK = KeyExist($McAfeeDlSite)
IF @ERROR = 0
$RK = WRITEVALUE($McAfeeDlSite, "bStoreAfter", "0", "REG_DWORD")
$RK = WRITEVALUE($McAfeeDlSite, "szUNCLocation", "M:\Updates", "REG_SZ")
; IF @ProductType = "Windows 2000 Professional"
; $RK = WRITEVALUE($McAfeeDlSite, "uUpdateFrom", "3", "REG_DWORD")
; ELSE
$RK = WRITEVALUE($McAfeeDlSite, "uUpdateFrom", "1", "REG_DWORD")
; ENDIF
; SHELL "$McAfeeExe /task update /Quiet"
SHELL "$McAfeeExe /task update"
$Message = $Message + "AntiVirus updated to V" + $McAfeeWVersion + $Cr2
ENDIF
ELSE
$Message = $Message + "Your AntiVirus is current (V" + $McAfeeWVersion + ")" + $Cr2
ENDIF
USE $McAfeeDrive /DELETE
;
;==========================================================================
MESSAGEBOX($message, "JGBS", 0,1)
:end1
COOKIE1
:end
Edited by Ashpoint (2003-12-28 09:44 AM)
|
|
Top
|
|
|
|
#110952 - 2003-12-29 05:13 AM
Re: INGROUP failing with SBS2003
|
Ashpoint
Starting to like KiXtart
Registered: 1999-08-27
Posts: 192
Loc: Sydney, NSW, Australia
|
It's up and running now.
I couldn't find the error so eventually did what Les suggested and stripped the system down to bare minimum (just a few lines) and succeeded in getting shares to happen.
Then, I slowly cut and pasted code to re-build bit by bit, testing each small change.
I don't THINK the new code is anything substantially different from the original but the new code works! I'm just happy to see it working and can't be bothered to see WHAT was the issue that caused my hassle.
I'm going to pin it to OOLLM! (One of life's little mysteries).
Thanks again for all assistance tendered by the several correspondents.
Best regards from Down Under (Sydney, Australia) Michael
|
|
Top
|
|
|
|
#110954 - 2003-12-29 06:06 PM
Re: INGROUP failing with SBS2003
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
This has been talked about before and in the later versions of KiXtart Guide, Ruud has addressed this and the examples should be corrected. If there is an example used from an older version KiXtart, then this would hold true.
Kent
|
|
Top
|
|
|
|
#110957 - 2003-12-30 09:32 AM
Re: INGROUP failing with SBS2003
|
Ashpoint
Starting to like KiXtart
Registered: 1999-08-27
Posts: 192
Loc: Sydney, NSW, Australia
|
My usual editor is Textpad, which I like VERY much.
Also, to Sealopard, I'm used to FoxPro programming where single quotes are the norm. When I've been writing code in KixTart, I'm often missing a double quote here and there. I'll be really pleased to adopt your convention.
Michael
|
|
Top
|
|
|
|
#110958 - 2003-12-30 02:08 PM
Re: INGROUP failing with SBS2003
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Michael,
Please... Please... Please...
It is KiXtart.. Not KixTart!
Kent
|
|
Top
|
|
|
|
#110959 - 2003-12-30 08:30 PM
Re: INGROUP failing with SBS2003
|
Ashpoint
Starting to like KiXtart
Registered: 1999-08-27
Posts: 192
Loc: Sydney, NSW, Australia
|
Humble... Humble... Humble...
KiXtart is now is.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|