Skip to content

Instantly share code, notes, and snippets.

@psolru
Last active March 25, 2023 16:45
Show Gist options
  • Save psolru/6a44a4de52a080a18829dcd2d7d07fea to your computer and use it in GitHub Desktop.
Save psolru/6a44a4de52a080a18829dcd2d7d07fea to your computer and use it in GitHub Desktop.
Quick and dirty powershell (5.1) snippet to create a service for windows exporter in windows10
// remove service
($service = Get-WmiObject -Class Win32_Service -Filter "Name='Windows Exporter'") -and ($service.Delete())
// add service
New-Service -Name "Windows Exporter" -BinaryPathName '"C:\Program Files (x86)\WindowsExporter\windows_exporter.exe" --web.listen-address ":9200" --collectors.enabled "ad,adcs,adfs,cache,cpu,cpu_info,cs,container,dfsr,dhcp,dns,exchange,fsrmquota,hyperv,iis,logical_disk,logon,memory,msmq,mssql,netframework_clrexceptions,netframework_clrinterop,netframework_clrjit,netframework_clrloading,netframework_clrlocksandthreads,netframework_clrmemory,netframework_clrremoting,netframework_clrsecurity,net,os,process,remote_fx,service,smtp,system,tcp,time,thermalzone,terminal_services,textfile,vmware"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment