There could be a few potential reasons for this behavior
1 - Check Group Policy settings: Verify that there are no Group Policy settings preventing users from changing the mouse primary button. Certain Group Policy settings can enforce specific mouse configurations and override individual user settings. Look into the Group Policy Editor (gpedit.msc) and navigate to User Configuration > Administrative Templates > Control Panel > Personalization to check for any relevant settings.
2 - Check permissions: Ensure that users have sufficient permissions to make changes to their mouse settings. Users should have at least standard user permissions to modify mouse settings.
3 - Test with local user: To rule out potential issues related to the Remote Desktop Services, log in directly to the Windows Server using a local account or domain user with administrative privileges, and try changing the mouse primary button settings. If it works for local users but not for remote users, the issue might be related to the RDS configuration.
4 - Verify the SwapMouseButton API: Check if the SwapMouseButton API function is functioning correctly by using a simple test script or program. Run a script to call the SwapMouseButton API and verify if the mouse button swapping is working as expected. If it doesn't work, it could indicate issues with the API function itself.
5 - Check for third-party software conflicts: Sometimes, third-party software or drivers can interfere with system functions. Ensure there are no third-party mouse management or customization software installed on the server that might be conflicting with the default Windows behavior.
6 - Update/Reinstall Mouse Drivers: Make sure that you have the latest mouse drivers installed. If there are any issues with the current drivers, updating or reinstalling them might help resolve the problem.