Are you adding a user to a group and then immediately running the script (without re-logging in)? If yes... try logging out and then back in.

Do you see any errors in the event log?