The error I get from pkcs11-tool.exe is "No slots."
My server has a hardware security module (Nitrokey HSM 2) that becomes inaccessible once I connect to my server via Windows Remote Desktop.
Note: this is NOT for logging in with smart cards. I use my HSM to decrypt data with its private key.
I use this HSM with the pkcs11-tool.exe recommended by Nitrokey.
It does not matter whether or not I uncheck the box "Smart Cards or Windows Hello for Business". A workaround is to use a different program (AnyDesk) to connect to the server, but that is not a solution because I don't want to rely on a 3rd party remote access app.
What I'm using is the Nitrokey HSM 2 (https://shop.nitrokey.com/shop/product/nk-hsm-2-nitrokey-hsm-2-7).
FYI. If you want to use this HSM on a server; it's very slow. Up to 2.5 seconds for just a single 2048-bit RSA private key decryption. That's not cool if a user needs to repeatedly perform this kind of task. It's also really cheap, at less than $150 delivered, so you get the best possible protection for a low price.