OpenRemoteBaseKey Key Import


hi,

i need import exported subkey registry file number of computers hklm.

i cannot via executing scriptblock remotely it's going give me inconsistent results.

i.e:

$hive = #registry location

$reg = [microsoft.win32.registrykey]::openremotebasekey('localmachine', $computer.name) $subkey = $reg.opensubkey($hive,$true)

#import c:\temp\reg.reg $subkey

hoping there 'bulk' way acheive without having insert/create/modify individual values in subkey's data.


invoke-wmimethod -name create -class win32_process  -argumentlist "regedit /s c:\temp\reg.reg" -computername $computer.name


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client