vb.net - VB NET Read Remote Registry -


i'm trying architecture , operating system of many remote pcs. in order i'm querying win32_operatingsystem , parsing "caption" o.s. , architecture im reading osarchitecture . in windows xp value not exists, thought reading hklm\system\currentcontrolset\control\session manager\environment\processor_architecture have done trick code:

            try              dim co new connectionoptions             co.impersonation = impersonationlevel.impersonate             co.authentication = authenticationlevel.packetprivacy             co.enableprivileges = true              co.username = username             co.password = password              dim scope new managementscope("\\" & machine.text & "\root\cimv2", co)              scope.connect()              dim environmentkey, asd2 microsoft.win32.registrykey             dim asd string              environmentkey = registrykey.openremotebasekey(registryhive.localmachine, machine.text)             asd2 = environmentkey.opensubkey("system\currentcontrolset\control\session manager\environment", true)             asd = asd2.getvalue("processor_architecture")              debug.print("asd: " + asd)              environmentkey.close()          catch ex exception              messagebox.show(ex.tostring)          end try 

my problem is: if im trying code system.security.securityexception: "accessing remote registry not permitted"

i am, , know administrator username , password. in fact if run simple cmdkey /add:targetname /user:username /pass:password works.

so why have run cmdkey /add if have alredy specified username , password in connectionoptions ??

p.s. sorry bad english

this may because remote registry access not enabled on target pc.

even if know administrator credentials, remote access registry not work if feature isn't enabled on target pc.

to enable it, see following microsoft knowledge base article, covers variety of windows operating systems: https://support.microsoft.com/en-us/kb/314837


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -