In case of 1) Win32 API doesn't allow to connect with different logon credentials, so in most cases you would get Access Denied error.In case of 2) StdRegProv doesn't provide enough features to read necessary information from the registry. So it cannot be used.
But the good news is that Show Logged On Users dialog allows to establish connection using different logon credentials. It works similar to Run As command, so it’s not 100% good solution but at least it’s better than nothing. Kindest Regards,SmartCode Solutions Support