I haven't got the rep to respond to @Mark Brackett's answer, I had to change a .ToInt32() to .TonInt64() which stopped the OverflowException I was getting with the example code.
This line
var pCurrentSessionInfo = new IntPtr(pSessionInfo.ToInt32() + (NativeMethods.SESSION_INFO_502.SIZE_OF * i));
Becomes
var pCurrentSessionInfo = new IntPtr(pSessionInfo.ToInt64() + (NativeMethods.SESSION_INFO_502.SIZE_OF * i));