title: powershell: Changing start type of services on a windows 7 machine
body: <p>Ive wrote a script to get the services of a machine and i want to mirror the StartMode to another machine.  I cant think of how to achieve the latter: setting the services on the remote machine.  Heres a script ive written so far:</p>
  
  <pre><code>#List of Issue of services 
  $NamesOfIssueServices = "Browser", "Dhcp", "Dnscache", "dwmrcs", "iphlpsvc", "LanmanServer", "LanmanWorkstation", "MMCSS", "MpsSvc", "Netlogon", "Netman", "netprofm", "NlaSvc", "nsi", "p2pimsvc","PNRPsvc","PolicyAgent", "SessionEnv", "stisvc", "W32Time", "WinHttpAutoProxySvc", "WinRM"
  
  #get all services 
  $W32Services = Get-WmiObject Win32_Service
  
  #filter wanted services 
  $IssueServices = $W32Services | Where-Object {$NamesOfIssueServices -contains $_.name}
  
  #display wanted services
  $IssueServices | Sort-Object name | ft Name, DisplayName, State, StartMode, StartName
  </code></pre>