mjoni
(Fresh Scripter)
2002-09-25 03:09 AM
@PRIMARYGROUP

When would you use this? I can't find any helpful information about what a primary group is used for. Any enlightenment will be appreciated!

Les
(KiX Master)
2002-09-25 03:13 AM
Re: @PRIMARYGROUP

The macro simply returns the primary group you assign in User Manager. What you do with it is up to you.

mjoni
(Fresh Scripter)
2002-09-25 03:20 AM
Re: @PRIMARYGROUP

There must be a documented reason for offering this in Windows or a guideline for its use. I read a bit about it being offered for compatibility with non-Windows operating systems, but nothing definitive. I was hoping someone here had some insight they could share.

Thanks!


Jack Lothian
(MM club member)
2002-09-25 03:36 AM
Re: @PRIMARYGROUP

I believe that on NT domains the primary group is something that is assigned & assignable for all users in the domain. As Les says, it's part of the domain definition of users & what you want to use it for is up to you. Personally, I have never seen a need to use it but in big complex organizations it could be more relevant. After all a user could be a member of multiple groups & distinguishing what's the users primary group might be relevant.

This is not a kixtart issue - it is an MS domain server issue.

[ 25. September 2002, 03:37: Message edited by: Jack Lothian ]


Sealeopard
(KiX Master)
2002-09-25 02:46 PM
Re: @PRIMARYGROUP

This is the group a new domain user is assigned to by default. By default, the primary group is 'Domain Users' but that can be changed. And, IIRC, a domain user has be a member of at least one group, which is then the primary group for that user.

Jummo
(Lurker)
2002-09-25 10:29 PM
Re: @PRIMARYGROUP

I'm using it right now to use different network mappings depending on the user.

Working on an education system, and the teacher has different mappings than the students.

The students are in "klasse(a-j)" so I find it useful here:

if(INSTR(@PRIMARYGROUP, "klasse")
USE x: "\\@LServer\@userid"
USE q: "\\@LServer\sdbdata"
USE k: "\\@LServer\@PRIMARYGROUP"
USE s: "\\@LServer\skolen"
else
if @Ingroup("laerere")
USE x: "\\@LServer\@userid"
USE q: "\\@LServer\sdbdata"
USE p: "\\@LServer\klasser"
USE s: "\\@LServer\skolen"
USE t: "\\@LServer\data"
USE l: "\\@LServer\brugere"
endif

Though Iīm having problems getting the RPC to work.....


Sealeopard
(KiX Master)
2002-09-25 10:32 PM
Re: @PRIMARYGROUP

You don't need to use the primary group for this. You can also map based on any group membership by using INGROUP. This is also more granular since a user can only be a member of one primary group.

What do you mean with 'getting the RPC' to work? Are you supporting Windows 9x? Then please read the approrpiate seciton in the FAQ Froum and the KiXtart Manual.


Jummo
(Lurker)
2002-09-25 11:20 PM
Re: @PRIMARYGROUP

The reason I did primarygroup was that I have several classe, "klasse" with the ending a-j or something.

I could create a global group "klasse", but I did this "primary group" instead. Because all the users in a certain klasse has that klasse as their primary group. And I havenīt got wildcards to work with INGROUP("klasse*")..

RPC is working now, just forgot to start it hehe.

And I had a lot of syntax errors in the posted example. Is being corrected at the moment


Sealeopard
(KiX Master)
2002-09-26 01:25 AM
Re: @PRIMARYGROUP

INGROUP can accept an array of groupnames since KiXtart 4.11.

Jummo
(Lurker)
2002-09-26 04:56 PM
Re: @PRIMARYGROUP

I solved it in another way:

DIM $group
Select
Case Ingroup("klassea") and not ingroup("laerere")
? $group = "klassea"
Case Ingroup("klasseb") and not ingroup("laerere")
? $group = "klasseb"
Case Ingroup("klasseb") and not ingroup("laerere")
? $group = "klassec"
Case Ingroup("klassed") and not ingroup("laerere")
? $group = "klassed"
Case Ingroup("klassee") and not ingroup("laerere")
? $group = "klassee"
Case Ingroup("klassef") and not ingroup("laerere")
? $group = "klassef"
Case Ingroup("klasseg") and not ingroup("laerere")
? $group = "klasseg"
Case Ingroup("klasseh") and not ingroup("laerere")
? $group = "klasseh"
Case Ingroup("klassei") and not ingroup("laerere")
? $group = "klassei"
Case Ingroup("klassej") and not ingroup("laerere")
? $group = "klassej"
Case Ingroup("laerer")
? $group = "laerer"
endselect
; Map Drives to the logon Server, change @LServer with \\terminalsrv if you use that.
;If it is a student, map k: to the correct klasse folder.
if INSTR($Group, "klasse")
USE x: "@LServer\@userid"
USE q: "@LServer\sdbdata"
USE k: "@LServer\$Group"
USE s: "@LServer\skolen"
else
;If itīs a teacher, we use different mappings
if Ingroup("laerere")
USE x: "@LServer\@userid"
USE q: "@LServer\sdbdata"
USE p: "@LServer\klasser"
USE s: "@LServer\skolen"
USE t: "@LServer\data"
USE l: "@LServer\brugere"
endif


Radimus
(KiX Supporter)
2002-09-26 05:21 PM
Re: @PRIMARYGROUP

put this in front:
Case Ingroup("laerer")

and you will not need the: ...and not Ingroup("laerer")