Description
This script enables the needed service remotely. It uses the case of that particular service is disabled by default. That is why the first “set-service” command is in needed to be applied. Device IP could be changed by changing “$IP” variable.
Source Code
$IP= "192.168.1.1"
#to enable service First
set-service -name "RemoteRegistry" -StartUpType Automatic -ComputerName $IP
# to start Service
set-service -name "RemoteRegistry" -Status "Running" -ComputerName $IP
# confirm the runnning server.
Get-WmiObject -Class win32_service -ComputerName $IP |select-object -Property name, state |where Name -eq "RemoteRegistry" |write-host
WRITE-host "$IP is done"