I want to run a .reg file remotely for changing its register
The code is
$nomservidor="ssvspospocpa2"
$pathserver="c:\temp\snmp.reg"
Invoke-Command -ComputerName $nomservidor -ScriptBlock {
Start-Process -FilePath "c:\windows\regedit.exe" -ArgumentList "/s $pathserver"
} -Credential pospocpa\administrator
It doesn't work although there is no error.
If I run
Start-Process -FilePath "c:\windows\regedit.exe" -ArgumentList "/s $pathserver"
directly in the server it Works ok so I don't Know where is the problem
Thanks
run a reg file remotely
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: run a reg file remotely
Use the remote registry classes of Net. They can do it without remoting.
See examples in the TechNet Gallery: http://gallery.technet.microsoft.com
See examples in the TechNet Gallery: http://gallery.technet.microsoft.com
- jramon.r@tv3.cat
- Posts: 25
- Last visit: Tue Jan 11, 2022 4:23 am
Re: run a reg file remotely
Here is a module you can install that will do what you ask:
Run this command:
find-module PoshRegistry
To install run this command:
find-module PoshRegistry | Install-Module
Run this command:
find-module PoshRegistry
To install run this command:
find-module PoshRegistry | Install-Module
- jramon.r@tv3.cat
- Posts: 25
- Last visit: Tue Jan 11, 2022 4:23 am