Page 1 of 1 1
Topic Options
#47581 - 2003-11-04 06:09 PM Using INSTR on INGROUP?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Kind of a silly question..

We have some groups that are pretty similar -

Jacksonville Users
DOMAINA\COMPANY Jacksonville
DOMAINB\COMPANY Jacksonville

Is it possible to to an INSTR(INGROUP('GROUPSTRING','JACKSONVILLE'))?

Thanks,

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

Top
#47582 - 2003-11-04 06:21 PM Re: Using INSTR on INGROUP?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
[Confused] What's up with that? INGROUP() doesn't do this.

What are you trying to do?
_________________________
There are two types of vessels, submarines and targets.

Top
#47583 - 2003-11-04 06:22 PM Re: Using INSTR on INGROUP?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Instead of having three different IF INGROUP statements.. Do a look for a common string - Jacksonville.

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

Top
#47584 - 2003-11-04 06:33 PM Re: Using INSTR on INGROUP?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I'm still confused. INGROUP returns a number based on whether the user is a member of any/all grousp provided to INGROUP. Then you do an INSTR onthat number?KiXtart Manual quote:
quote:
If InGroup("Developers", "Testers") = 1
? "Member of Developers OR Testers group"
EndIf

_________________________
There are two types of vessels, submarines and targets.

Top
#47585 - 2003-11-04 06:40 PM Re: Using INSTR on INGROUP?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
The only way I can think of doing this is to ENUMGROUP the user and then check for presence of the string to look for.

Never mind.

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

Top
#47586 - 2003-11-04 06:44 PM Re: Using INSTR on INGROUP?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Where does this come from?

If you take the Macro @WKSTA, you can run a specific part of the script based on the Workstation name, for example:

code:
;WORKSTATION NAMES ARE: NAME01,NAME02,NAME03
IF INSTR(@WKSTA,'NAME')
;DO WHATEVER
ENDIF

I was thinking how we could do this based on Group Membership.

Because today, you have to do this like:
code:
IF INGROUP('Jacksonville Users') OR INGROUP('DOMAINA\COMPANY Jacksonville') OR INGROUP('DOMAINB\COMPANY Jacksonville')
;DO WHATEVER
ENDIF

Or..
code:
IF INGROUP('Jacksonville Users','DOMAINA\COMPANY Jacksonville','DOMAINB\COMPANY Jacksonville')
;DO WHATEVER
ENDIF

HTH,

Kent

[ 04. November 2003, 18:49: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#47587 - 2003-11-04 06:47 PM Re: Using INSTR on INGROUP?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Maybe...

break on

$Index = 0
DO
$Group = ENUMGROUP($Index)
$Grps = $Grps + "~" + $Group
$Index=$Index+1
UNTIL Len($Group) = 0

If instr($Grps, "Jackson")
Do something...
Endif
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#47588 - 2003-11-04 07:13 PM Re: Using INSTR on INGROUP?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
break on

for each $group in enumgroups('jacksonville')
? $group
next



Function EnumGroups(optional $filter)
dim $domain, $group, $groups
$domain = getobject("WinNT://@domain")
$domain.filter = "group",""
for each $group in $domain
if not $filter or instr($group.name,$filter)
$groups = $groups + '|' + $group.name
endif
next
$domain = 0
$EnumGroups = split(substr($groups,2),'|')
EndFunction
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#47589 - 2003-11-04 07:16 PM Re: Using INSTR on INGROUP?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
if ingroup(enumgroups('jacksonville'))
...
endif
_________________________
How to ask questions the smart way <-----------> Before you ask

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 194 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.206 seconds in which 0.171 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