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:
hoping there 'bulk' way acheive without having insert/create/modify individual values in subkey's data.$hive = #registry location
$reg = [microsoft.win32.registrykey]::openremotebasekey('localmachine', $computer.name) $subkey = $reg.opensubkey($hive,$true)
#import c:\temp\reg.reg $subkey
invoke-wmimethod -name create -class win32_process -argumentlist "regedit /s c:\temp\reg.reg" -computername $computer.name
Windows Server > Windows PowerShell
Comments
Post a Comment