Re: Registy access via WMI in C#

From: Alek Davis (stop_spam_alek.davis@intel.com)
Date: 01/14/03


From: "Alek Davis" <stop_spam_alek.davis@intel.com>
Date: Mon, 13 Jan 2003 17:21:22 -0800


Why don't you simply use RegistryKey.OpenRemoteBaseKey method to open a key
on remote machine? This sounds pretty straight-forward.

-- Alek

"Dr. Strangedub" <strangedub@netscape.net> wrote in message
news:3e233198.449674677@news.rsvl.unisys.com...
> We are in the process of converting some specialized ASP web applications
from
> asp (using VBScript / Javascript) to ASP.NET (using C#). One of the
functions
> of our applications is to update the Windows registry on a remote host
(either
> the host where the web exists, or another host). Today the server-side
VBScript
> uses WMI to access the registry via the StdRegProv class as follows:
> ==
> Set objRegistry = GetObject("winmgmts:root\default:StdRegProv")
> lAccess = KEY_NOTIFY + KEY_QUERY_VALUE + KEY_SET_VALUE
> Err.Clear ' Initialize error status
> lRC = objRegistry.CheckAccess(HKEY_LOCAL_MACHINE, shortPath,
lAccess,bGranted)
> ==
>
> I would appreciate any help (code samples, links, other docs) in coding
this
> logic in C#. We picked up the string "winmgmts:root\default:StdRegProv"
used on
> the GetObject call from an example at the online MSDN site -- and there
seemed
> to be no real explanation of how this string gets us to a Namespace.
>
> I know we could simply use the Microsoft.Win32 Namespace if our registry
access
> was limited to the localhost (i.e., the web server host), but we really do
need
> to do remote updates as well.
>
> Thanks in advance for any help on this.
>
> -Michael G. Rose
> Unisys Corp.
> michael.rose@unisys.com
>
>



Relevant Pages

  • Re: Cache coherency issues using AllocateCommonBuffer(..)
    ... we did put a scope on the remote system looked at the TLPs coming ... and so it seems like we are stuck with AllocateCommonBuffer. ... standard non-common buffer based DMA APIs. ... How soon do you read from the host memory after you believe the DMA ...
    (microsoft.public.development.device.drivers)
  • Re: Error messages for remote desktop connection attempt
    ... Did you enable Remote Desktop connections on the XP Pro host? ... have you checked the EventLog on the host? ... "The net logon service on the local computer started and then ...
    (microsoft.public.windows.terminal_services)
  • Remote registry access between two Win XP Pro computers
    ... I'm trying to do remote registry by two different methods: ... I see that the remote registry service is started and is automatic on both ... two keys are HKLM and HKCU. ... permissions or see if I'm on the access list as admin. ...
    (microsoft.public.windowsxp.network_web)
  • Question about RSA1 vs DSA fingerprint
    ... I'm connecting to a solaris 8 box on a university LAN, ... This is the "remote" host. ... cygwin, via Sympatico ADSL, ssh version ...
    (comp.security.ssh)
  • Re: Any free or low cost shareware to save registry, compact, remote connection?
    ... But it is not as simple as the Remote Desktop or the Remote ... > system using Drive Image and that takes care of the registry. ... The version of Ghost ... Any ideas besides OEM Norton disks? ...
    (microsoft.public.windowsxp.general)