Last active
March 25, 2023 16:45
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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