I am creating a site that receives user information using the WindowsIdentity of the current user. The main information I get from this is ssid.
I do this for current users as follows
IntPtr logonToken = WindowsIdentity.GetCurrent().Token; WindowsIdentity windowsId = new WindowsIdentity(logonToken); string ssid = windowsId.User.ToString();
What I need to do now, and I fail, gets ssid for any arbitrary username that exists in the domain.
I tried WindowsIdentity (string), but that gave me a SecurityException
The specified name is not a correctly formed account name.
source share