Using RegistryKey.OpenRemoteBaseKey on a non-Domain computer

  • Thread starter Thread starter Jerry Spence1
  • Start date Start date
J

Jerry Spence1

I am trying to get registry information from another PC that is not part of
a domain.I have tried the following:

Dim key = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,
\\computername).OpenSubKey("Software").GetSubKeyNames

and this works OK, but it must be because I have the same username and
password on both machines. I can't find any options for specifying the
remote username/password when using OpenRemoteBaseKey.

Any ideas?

-Jerry
 
I am trying to get registry information from another PC that is not part of
a domain.I have tried the following:

Dim key = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,
\\computername).OpenSubKey("Software").GetSubKeyNames

and this works OK, but it must be because I have the same username and
password on both machines. I can't find any options for specifying the
remote username/password when using OpenRemoteBaseKey.

Any ideas?

-Jerry

I think you might need to use impersonation to "pretend" to be another
user before calling this. Do some searching in this newsgroup's
archives to turn up some links on how to use impersonation.

Thanks,

Seth Rowe
 
rowe_newsgroups said:
I think you might need to use impersonation to "pretend" to be another
user before calling this. Do some searching in this newsgroup's
archives to turn up some links on how to use impersonation.

Thanks,

Seth Rowe
Thanks Seth. I've tried looking but (so far), they all make references to
domains. I'll keep looking.

-Jerry
 
Jerry Spence1 said:
Thanks Seth. I've tried looking but (so far), they all make references to
domains. I'll keep looking.

-Jerry
I've found some impersonation code that (sort of) works, and I created a
user on the other PC called freddy but when I tried impersonating freddy, my
identity was actually MyPC/GUEST. I'm wondering if there are some tweaks I
need to do to allow me to log on as freddy.

-Jerry
 
Back
Top