We've been struggling on how to determine if a local user is already in a
local group. We have code (C#) that creates a local user, if the user
doesn't already exist. And, we have code (C#) that creates a local group,
if the group doesn't already exist. Both of these work fine.
Now, we need to check whether the local user is already in the local group
or not. We have code (C#) that adds the local user to the local group, but
we cannot get any code to work to first determine if the local user is
already in the local group (because if the local user is already in the
local group, we don't want to try to add them).
Would anyone know how to determine if a local user is in a local group?