Im using powershell, as Administrator in windows8.1.
I give the command Restart-Service netmon but it fails with no service found.
ok, how do I restart netmon then?
- 1,570
1 Answers
First of all - your Service Same doesn't always match the Service Display Name. In this example - I would need to Restart-Service vds:
If you want to get a full service list and look at the service name, you can do a simple Get-Service:

You could then narrow this down using a "Where" clause similar to this Get-Service | Where {$_.Name -like "Net*"}:

(Or you could just find your service in services.msc or you could use sc query)
When you have your actual service name, you can then restart, stop, start or query the service:
Stop-Service | Start-Service | Restart-Service | Get-Service
Sometimes you will get a service error stating that the service isnt installed on your machine. Normally this is because you aren't running "As Admistrator":

By Elevating, these commands will start to work again:
The error message isn't very good for this - and I've seen it trip people up before several times.
Edit - just re-read your question and seen you say you are running as Admin already. Are you able to post a screenshot for us please? Or confirm it by running the following:
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] “Administrator”)){
Write-Warning “You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!”
}
If your session has been properly elevated, you won't get the warning as shown in the below screenshot:

- 12,965
