[SAMSRV]
[reactos.git] / reactos / dll / win32 / samsrv / user.c
index 04ca49f..a442780 100644 (file)
@@ -361,6 +361,8 @@ SampRemoveUserFromAllGroups(IN PSAM_DB_OBJECT UserObject)
 
         Status = SampRemoveMemberFromGroup(GroupObject,
                                            UserObject->RelativeId);
+        if (Status == STATUS_MEMBER_NOT_IN_GROUP)
+            Status = STATUS_SUCCESS;
 
         SampCloseDbObject(GroupObject);
 
@@ -370,6 +372,13 @@ SampRemoveUserFromAllGroups(IN PSAM_DB_OBJECT UserObject)
         }
     }
 
+    /* Remove all groups from the Groups attribute */
+    Status = SampSetObjectAttribute(UserObject,
+                                    L"Groups",
+                                    REG_BINARY,
+                                    NULL,
+                                    0);
+
 done:
     if (GroupsBuffer != NULL)
         midl_user_free(GroupsBuffer);