View Single Post
Old 01-09-2007   #2 (permalink)
Gaurhoth


 
 

Re: Copy-Item or Copy-ItemProperty and Remote Registry.

I don't believe powershell's new-psdrive supports remote registry access. Best bet is probably dotnet... example below...

PS ps:\> $computer = "COMPUTER1"
PS ps:\> $rk = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine,$computer)
PS ps:\> $rr = $rk.opensubkey("\Software\Microsoft\Internet Explorer")
PS ps:\> $rr.GetValue("Version")
7.0.6000.16386
PS ps:\>

Obviously I'm not trapping for any errors in this example (which you will get if the remote computer cannot be contacted, permission is denied, etc).

As for 2 and 3, haven't tried either.

--

gaurhoth
http://gaurhothw.spaces.live.com/


"Brandon Shell" <tshell.mask@gmail.com> wrote in message news:uPhN7IANHHA.320@TK2MSFTNGP06.phx.gbl...
> There are a couple of questions on this one.
>
> 1) Can I use new-psdrive to mount a remote registry?
>
> 2) Can I use copy-item or Copy-ItemProperty on Registry keys?
>
> 3) Can I use copy-item or Copy-ItemProperty on anything or does it have to
> be a PSDrive?
>
> Brandon Shell
> ---------------
> Stop by my blog some time
> http://mybsinfo.blogspot.com/
> ----------------------------------
>

My System SpecsSystem Spec