mhammond / pywin32

Python for Windows (pywin32) Extensions
5.01k stars 792 forks source link

NetLocalGroupDelMembers remove user by sid #2178

Closed sfonteneau closed 7 months ago

sfonteneau commented 7 months ago

https://learn.microsoft.com/fr-fr/windows/win32/api/lmaccess/nf-lmaccess-netlocalgroupdelmembers

According to the Microsoft documentation, The functions win32net.NetLocalGroupAddMembers and win32net.NetLocalGroupDelMembers Should work the same

But NetLocalGroupDelMembers give : function takes exactly 3 arguments (4 given)

In my case I want to delete a user from a group starting from a sid, (it's an orphan sid) I feel like it's not possible

I managed to add by sid with NetLocalGroupAddMembers (4 args accept)

Is this normal behavior?

sfonteneau commented 7 months ago

Use NetLocalGroupSetMembers