woodstock
(Lurker)
2002-07-09 12:59 AM
If InGroup not working

This portion of my login script is not working.
Here is an example of what I have.
if InGroup ("beth&les")
use i: "\\russet\beth&les" /persistent
endif

Why isn't this working? If I just use the "use" command without the if it works fine.

Any help would be great.
Thanks


MCA
(KiX Supporter)
2002-07-09 01:19 AM
Re: If InGroup not working

Dear,

Welcome to the board.

Please try following script and return output to the board.
code:
IF (Ingroup("beth&les") <> 0)
? "user @userid is member of BETH&LES"
ELSE
? "user no mber of"
ENDIF

USE LIST
IF (Ingroup(""beth&les") <> 0)
USE i: "\\russet\beth&les"
IF (@error <> 0) THEN
? "Warning KIX-USE: error @error (@serror)"
ELSE
? "Informative KIX-USE: no error"
ENDIF
ENDIF

Try also script for another group without special "&"-symbol in it.
greetings.


woodstock
(Lurker)
2002-07-09 04:03 PM
Re: If InGroup not working

Still nothing happening

Sealeopard
(KiX Master)
2002-07-09 04:08 PM
Re: If InGroup not working

What do you mean, nothing happens?
Does the example code provided to you say that the suer is or is not a member of the group BETH&LES? If you try the same code for a group that dows not contain any special characters like '&' do you still have problems.

Create a user with membership in the following two groups: TESTGROUP, TEST&GROUP, the run this little piece of code:
code:
if ingroup('TESTGROUP')
? 'user '+@USERID'+'is a member of group TESTGROUP'
else
? 'user '+@USERID'+'is NOT a member of group TESTGROUP'
endif
if ingroup('TEST&GROUP')
? 'user '+@USERID'+'is a member of group TEST&GROUP'
else
? 'user '+@USERID'+'is NOT a member of group TEST&GROUP'
endif

Please report back after running this with all error messages that might ahve been created and the results for both IF-ENFIF evaluations.


MCA
(KiX Supporter)
2002-07-09 05:10 PM
Re: If InGroup not working

Dear,

Try following script and return the output of file %tmp%\kixdebug.txt to the board.
At the begin a messagebox will be presented.
code:
                                                           CLS
COLOR C+/N
AT (1,1) " "

$_debug_file="kixdebug.txt" ; - %tmp% directory -
;
IF (len($_debug_file) <> 0)
IF (substr(ExpandEnvironmentVars("%tmp%"),len(ExpandEnvironmentVars("%tmp%")),1) = "\")
$_debug_file=ExpandEnvironmentVars("%tmp%")+$_debug_file
ELSE
$_debug_file=ExpandEnvironmentVars("%tmp%")+"\"+$_debug_file
ENDIF
ENDIF
;$_debug_file="c:\kixdebug.txt"
$_debug_file=LCASE($_debug_file)
IF RedirectOutput($_debug_file)
ENDIF

? "-"+LCASE(@day)+" "+@date+" "+@time+"- kixtart "+@kix+"/3.13e script starting."
? "-"
? "-curdir: "+LCASE(@curdir)
? "-scriptdir: "+LCASE(@scriptdir)
IF (instr("-4.1x-","-"+substr(@kix,1,3)+"x-") <> 0)
? "-scriptname: "+LCASE(@scriptname)
ENDIF
? "-startdir: "+LCASE(@startdir)
? "-"
? "-userid: "+LCASE(@userid)+"/"+LCASE(@wuserid)
? "-user priv: "+LCASE(@priv)
IF (instr("-4.xx-","-"+substr(@kix,1,2)+"xx-") <> 0)
? "-version: inwin="+@inwin+"/dos="+@dos"/productsuite="+@productsuite+"/producttype="+@producttype"/csd="+LTRIM(RTRIM(@csd))
ELSE
? "-version: inwin="+@inwin+"/dos="+@dos
ENDIF

DIM $_debug_name
$_debug_name=""
IF (instr("-4.xx-","-"+substr(@kix,1,2)+"xx-") <> 0)
$_debug_name=@msecs
SELECT
CASE (len($_debug_name) = 1)
$_debug_name="00"+$_debug_name
CASE (len($_debug_name) = 2)
$_debug_name="0"+$_debug_name
ENDSELECT
$_debug_name="."+$_debug_name
IF srnd(@msecs)
ENDIF
ENDIF
$_debug_name=substr(@date,1,4)+substr(@date,6,2)+substr(@date,9,2)+"_"+substr(@time,1,2)+substr(@time,4,2)+substr(@time,7,2)+$_debug_name+"_"+rnd(32767)
IF (len($_debug_name) < 25)
$_debug_name=substr($_debug_name+" ",1,25)
ENDIF
IF (instr("-4.1x-","-"+substr(@kix,1,3)+"x-") <> 0)
IF (len(@scriptname) < 12)
$_debug_name=$_debug_name+" "+LCASE(substr(@scriptname+" ",1,12))
ELSE
$_debug_name=$_debug_name+" "+LCASE(@scriptname)
ENDIF
ENDIF
? "-debug file: "+$_debug_file
? "-debug name: "+$_debug_name
? "-"
?"----- start-"+@time+"-"+$_debug_name+"- @error @serror"?
IF (MessageBox("kixtart @kix starting","kixtart info",0,5) <> 0)
ENDIF
?"- 1-"+@time+"-"+$_debug_name+"- @error @serror"? IF (Ingroup("beth&les") <> 0)
?"- 2-"+@time+"-"+$_debug_name+"- @error @serror"? ? "user @userid is member of BETH&LES"
?"- 3-"+@time+"-"+$_debug_name+"- @error @serror"? ELSE
?"- 4-"+@time+"-"+$_debug_name+"- @error @serror"? ? "user no mber of"
?"- 5-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF
?"- 6-"+@time+"-"+$_debug_name+"- @error @serror"?
?"- 7-"+@time+"-"+$_debug_name+"- @error @serror"? USE LIST
?"- 8-"+@time+"-"+$_debug_name+"- @error @serror"? IF (Ingroup("beth&les") <> 0)
?"- 9-"+@time+"-"+$_debug_name+"- @error @serror"? USE i: "\\russet\beth&les"
?"- 10-"+@time+"-"+$_debug_name+"- @error @serror"? IF (@error <> 0) THEN
?"- 11-"+@time+"-"+$_debug_name+"- @error @serror"? ? "Warning KIX-USE: error @error (@serror)"
?"- 12-"+@time+"-"+$_debug_name+"- @error @serror"? ELSE
?"- 13-"+@time+"-"+$_debug_name+"- @error @serror"? ? "Informative KIX-USE: no error"
?"- 14-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF
?"- 15-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF

?"------- end-"+@time+"-"+$_debug_name+"- @error @serror"?
? "-"
? "-"+LCASE(@day)+" "+@date+" "+@time+"- kixtart "+@kix+"/3.13e script ending."
? "-"
IF (instr("-4.1x-","-"+substr(@kix,1,3)+"x-") <> 0)
? "-"+@cpu+" ("+@mhz+" Mhz, memory "+MemorySize()+" MB)"
ENDIF
? "-"
IF RedirectOutput("CON")
ENDIF
COLOR C+/N
?
? "debugging information "+CHR(34)+$_debug_file+CHR(34)
IF RedirectOutput($_debug_file)
ENDIF

greetings.


woodstock
(Lurker)
2002-07-10 06:26 PM
Re: If InGroup not working

I tried running this script but I get a script error Error in parameters in str ExpandenvironmentVars

LonkeroAdministrator
(KiX Master Guru)
2002-07-10 06:33 PM
Re: If InGroup not working

try with this shorter one:
code:
?"----- start-"+@time+"-"+$_debug_name+"- @error @serror"?
IF (MessageBox("kixtart @kix starting","kixtart info",0,5) <> 0)
ENDIF
?"- 1-"+@time+"-"+$_debug_name+"- @error @serror"? IF (Ingroup("beth&les") <> 0)
?"- 2-"+@time+"-"+$_debug_name+"- @error @serror"? ? "user @userid is member of BETH&LES"
?"- 3-"+@time+"-"+$_debug_name+"- @error @serror"? ELSE
?"- 4-"+@time+"-"+$_debug_name+"- @error @serror"? ? "user no mber of"
?"- 5-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF
?"- 6-"+@time+"-"+$_debug_name+"- @error @serror"?
?"- 7-"+@time+"-"+$_debug_name+"- @error @serror"? USE LIST
?"- 8-"+@time+"-"+$_debug_name+"- @error @serror"? IF (Ingroup("beth&les") <> 0)
?"- 9-"+@time+"-"+$_debug_name+"- @error @serror"? USE i: "\\russet\beth&les"
?"- 10-"+@time+"-"+$_debug_name+"- @error @serror"? IF (@error <> 0) THEN
?"- 11-"+@time+"-"+$_debug_name+"- @error @serror"? ? "Warning KIX-USE: error @error (@serror)"
?"- 12-"+@time+"-"+$_debug_name+"- @error @serror"? ELSE
?"- 13-"+@time+"-"+$_debug_name+"- @error @serror"? ? "Informative KIX-USE: no error"
?"- 14-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF
?"- 15-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF

?"------- end-"+@time+"-"+$_debug_name+"- @error @serror"?
? "-"
?"press enter to quit"
gets $nothing

and copy the output to post.

cheers,

[ 10 July 2002, 18:34: Message edited by: Lonkero ]


MCA
(KiX Supporter)
2002-07-10 06:51 PM
Re: If InGroup not working

Dear woodstock,

Which kixtart version running? This function was introducing at Kixtart 3.61 release.
greetings.


Kdyer
(KiX Supporter)
2002-07-10 06:55 PM
Re: If InGroup not working

Addtionally, there was no mention of Win9x nor NT.. If this Win9x, you want to be sure KXRPC is deployed on your DCs.

Kent