' Add a user to a group. Ignore "User already belongs to that group" error

Set AU = Server.CreateObject("Persits.AspUser")
AU.IncludeErrorCode = True ' prefix all error message with genuine NT error codes
AU.LogonUser "MYDOMAIN", "Administrator", "xxxxxx"
Set User = AU.Users("peter")

On Error Resume Next
User.AddToGroup "Domain Guests"

If Left(Err.Description, 4) <> "08BC" Then ' Ignore NERR_UserInGroup
   Response.Write Mid(Err.Description, 6) ' skip error code prefix
End If

On Error Goto 0 ' Cancel error trapping