Lue englanniksi

Jaa


How to manage processes and services

Because SMB is often blocked, and Remote Desktop is not supported, managing processes and services on Nano Server may require a different pattern. PowerShell Remoting over Windows Remote Management (WSMan) and web-based Server Management Tools (SMT) can provide a robust method to manage processes and services on Nano Server.

  1. Connect to Nano Server remotely.

    To access Nano Server remotely, please follow the steps in How to access Nano Server.

  2. To manage processes

    To list all running processes:

    PowerShell
    Get-Process
    

    You can filter by name:

    PowerShell
    Get-Process -Name *svc*
    

    Or use a "where" clause for more powerful filtering:

    PowerShell
    Get-Process | where PeakPagedMemorySize -gt 100MB
    

    Tip  Once you’ve typed "where" and the following space, you can press Ctrl+Spacebar for an IntelliSense list of possible property values.

     

    To find out which properties a process object has:

    PowerShell
    Get-Process | Get-Member
    

    To kill one or more processes, pipe the result of a Get-Process cmdlet to Stop-Process:

    PowerShell
    Get-Process -Name winword | Stop-Process
    

    Or use Stop-Process directly:

    PowerShell
    Stop-Process -Name groove, notepad
    

    To start a process:

    PowerShell
    Start-Process -FilePath C:\Windows\notepad.exe
    

    To list the top 10 processes with the highest CPU utilization:

    PowerShell
    Get-Process | sort -Descending | select -First 10
    
  3. To manage services

    To list all running services:

    PowerShell
    Get-Service
    

    You can filter by name:

    PowerShell
    Get-Service -Name win*
    

    Or use a where clause for more powerful filtering:

    PowerShell
    Get-Service | where Status -eq Stopped
    

    To register a service:

    PowerShell
    New-Service -Name myService -BinaryPathName C:\Services\myService.exe -StartupType Manual
    

    To start a service, pipe the result of a Get-Service cmdlet to Start-Service:

    PowerShell
    Get-Service -Name wec* | Start-Service
    

    Or use Start-Service directly:

    PowerShell
    Start-Service -Name wec*
    

    To stop a service:

    PowerShell
    Get-Service -Name wec* | Stop-Service