Page 1 of 1 1
Topic Options
#212240 - 2017-01-24 02:58 PM IF Ingroup LIKE groupname*
agi2016 Offline
Just in Town

Registered: 2017-01-24
Posts: 1
Loc: Duisburg, Germany
Hi,
i have the problem to found out which memberships the user has, by using the following code:
we have several grounames like SYS_MIKE_xyz and want to check if the user is in one of these groups to map a share:


The following works:
if ingroup("SYTEM_MIKE_TEST1")
use Z: /delete /persistent
use Z: $Filsrv1 + "ShareX"
endif

The following works NOT by using the spaceholder (*):
if ingroup("SYTEM_MIKE_TEST*")
use Z: /delete /persistent
use Z: $Filsrv1 + "ShareX"
endif

Top
#212241 - 2017-01-24 03:54 PM Re: IF Ingroup LIKE groupname* [Re: agi2016]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Ingroup does not have this functionality. There are other group UDFs including GetADUserGroups - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=198609#Post198609

Something like this should work... untested.

 Code:
$UserGroups=GetADUserGroups()
if ascan($Usergroups,"SYTEM_MIKE_TEST",,,1)
  ;do stuff
endif


How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1

Top
#212251 - 2017-01-31 06:35 PM Re: IF Ingroup LIKE groupname* [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
I realize this guy is probably not coming back but I felt like this was moderately interesting.

Again Untested, and still requires the GetADUserGroups UDF linked above.

 Code:
Function InGroupLIKE($LikeGroup,optional $Groups)
  if ubound($groups)=-1
    $groups=GetADUserGroups()
  endif
  $InGroupLIKE=iif(ascan($groups,$LikeGroup,,,1)>-1,1,0)  
Endfunction



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 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.052 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

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