I got administrative rights on the target machine, all the credentials, fully trusted network without firewall and antivirus software. I got windows 8 on the target machine and windows 7 on calling one.
- I need to restart a windows service by its name. I have this name.
I got the IP address of that machine. I have the simple shell. I could use the powershell however.
Still I cannot find on the internet the fine shell command to do this. Everything I find says either it is impossble or providing not working piece of code.
Update: Both computers are located ta my home and does not belong to domain. They only share teh same workgroup.
Update:
Just created a powershell script:
$password = convertto-securestring -string 'pwd_string' -asplaintext -force
$credential = new-object -typename System.Management.Automation.PSCredential -argumentlist "AF", $password
$service = gwmi win32_service -computername "AgentFire" -filter "name='Sharedaccess'" -credential $credential
$service.stopservice()
Start-Sleep -s 3
$service.startservice()
gwmi says access denied, though credentials are valid.