Page 1 of 1 1
Topic Options
#110945 - 2003-12-27 11:44 PM INGROUP failing with SBS2003
Ashpoint Offline
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
#110946 - 2003-12-28 02:05 AM Re: INGROUP failing with SBS2003
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You have a rogue quote further down (or up) in the script.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110947 - 2003-12-28 03:58 AM Re: INGROUP failing with SBS2003
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Please either post the full script or download kixstrip tool from MCAs site.

Somewhere in your script you have an incomplete command, normally caused by either a missing quote or one too many quotes, or quotes in the wrong place.

Top
#110948 - 2003-12-28 04:50 AM Re: INGROUP failing with SBS2003
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
...or simply run the script in debug mode.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110949 - 2003-12-28 07:50 AM Re: INGROUP failing with SBS2003
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#110950 - 2003-12-28 09:40 AM Re: INGROUP failing with SBS2003
Ashpoint Offline
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
#110951 - 2003-12-28 04:47 PM Re: INGROUP failing with SBS2003
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You are contradicting yourself. First you said:
Quote:

IF INGROUP("Private") fails with a message "Unknown Command [Private]"




As for your first error, if KiX interprets the InGroup() parm "Private" as a command, generally that means there is mismatched quotes, parens, or other delimiter. When running in debug, watch the command lines just before the error for clues.

Now you say:
Quote:

;;;; Code exits to OS about here
USE $IDRDrive /DELETE




Don't be vague. Is it bailing on or before that line? You may want to include the /PERSISTENT switch for good measure.

There have been cases documented where two identical looking snippets of code behave differently where one of them has something hidden in the white space. Retyping it word for word will fix it.

Strip your code down to the absolute smallest that still errors and try retyping it in a new file.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110952 - 2003-12-29 05:13 AM Re: INGROUP failing with SBS2003
Ashpoint Offline
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
#110953 - 2003-12-29 06:03 PM Re: INGROUP failing with SBS2003
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
We have had a similar problem before, after editing it in a different word processor than usual (probably word instead of notepad). It somehow screws up the quotes from the regular " ones to the curvy ones that you see in Word. These curvy quotes were not recognized by Kix and was thought to be part of the name.
Top
#110954 - 2003-12-29 06:06 PM Re: INGROUP failing with SBS2003
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#110955 - 2003-12-29 06:37 PM Re: INGROUP failing with SBS2003
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
While the curlies could possibly be to blame, I am sticking with the gremlins in the white space theory.
Re: Did you ever ?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110956 - 2003-12-30 03:44 AM Re: INGROUP failing with SBS2003
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
And I highly recommend to add
Code:

$rc=setoption('explicit','on')
$rc=setoption9'novarsinstrings','on')

as the first lines of code and to only use single quotes (') as string delimiters unless a double quote (") is aboslutely necessary. Double quotes should be restriced to enclosing file/pathnames that might contain spaces.
_________________________
There are two types of vessels, submarines and targets.

Top
#110957 - 2003-12-30 09:32 AM Re: INGROUP failing with SBS2003
Ashpoint Offline
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 Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Michael,

Please... Please... Please...

It is KiXtart.. Not KixTart!

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#110959 - 2003-12-30 08:30 PM Re: INGROUP failing with SBS2003
Ashpoint Offline
Starting to like KiXtart

Registered: 1999-08-27
Posts: 192
Loc: Sydney, NSW, Australia
Humble... Humble... Humble...

KiXtart is now is.

Top
#110960 - 2003-12-30 08:41 PM Re: INGROUP failing with SBS2003
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Great! That edit is a lot easier than what you would have to do to implement Jens' suggestion of $rc=setoption('novarsinstrings','on'). One thing though, if/when Ruud stops supporting vars in strings, you will have a jump on it.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

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

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