diff --git a/reactos/dll/win32/samsrv/user.c b/reactos/dll/win32/samsrv/user.c index 04ca49f9912..a442780992a 100644 --- a/reactos/dll/win32/samsrv/user.c +++ b/reactos/dll/win32/samsrv/user.c @@ -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);