Ok, I finally actually tested the original UDF, and it works fine for me. My guess is, you are incorrectly accessing the multiple dimension array that is returned, which is what is causing your errors. Nothing is wrong with the UDF itself.

STOP BELIEVEING CHATGPT KNOWS HOW TO PROGRAM IN KIX. It's a good source for information, but can only do so much. It led you down a rabbit hole you never needed to go down.

 Code:
$dom = "DOMAIN"
$acct = "USER"

$groups = GetGroups($dom, $acct)

For $i = 0 to UBound($groups, 0)
	? $groups[0,$i]
Next

get $


Edited by ShaneEP (2023-06-28 05:39 PM)