Monitoring Windows servers with Prometheus windows_exporter

Learn how to monitor Windows Server hosts and roles such as Active Directory, AD FS and IIS with the community windows_exporter, from collector choice to securing port 9182.

On this page

How windows_exporter brings Windows Server into Prometheus monitoring

If Prometheus does not yet see your Windows estate, the gap is usually the most important servers: domain controllers, AD FS farms and IIS web tier. windows_exporter is the community Prometheus exporter for Windows machines, and Prometheus scrapes it over HTTP on port 9182 by default. The exporter is maintained in the prometheus-community organization on GitHub, and it runs as a service on each Windows host. Prometheus does the pulling, so each host exposes metrics and the Prometheus server decides what to scrape and how often. The exporter does not push data anywhere, which keeps the host-side change small and the scrape configuration in one place.

The most important design decision is which collectors to enable, and it should be made per role rather than once for the whole fleet. The collectors flag takes a comma-separated list, and [defaults] expands to the collectors enabled out of the box, so a team can start from the defaults and add role-specific collectors such as Active Directory Domain Services, Active Directory Certificate Services or AD FS where those roles exist. A file server does not need the directory collectors, and a domain controller should not be left on a generic profile. Before rollout, confirm the exact collector names and their current defaults against the windows_exporter repository, because the list changes between releases.

Prometheus itself is licensed under Apache-2.0 and has no paid enterprise edition, so the software line in your budget is zero. The real costs are the server that runs Prometheus, the storage it needs, and the people who install, configure, upgrade and respond to alerts from the exporter. Those costs recur, while the initial collector selection, service account setup and scrape configuration are mostly one-time work. Ask any partner for a quote that separates design, deployment, role-specific dashboards and alert rules, and ongoing upgrades, so you can see which parts your own team can carry.

What you need before installing windows_exporter

Five items should be confirmed before the exporter goes onto a single Windows host. Each one decides whether the first scrape succeeds and whether the endpoint stays protected once it is running. Confirm the details against the windows_exporter repository and your own environment before scheduling the change.

Supported Windows Server versions

Confirm which Windows Server versions the windows_exporter release you plan to use supports. Support changes between releases, so check the release notes and compatibility statements in the windows_exporter repository rather than relying on an older page or a colleague's memory. Inventory every host type you intend to monitor, including domain controllers, AD FS servers and IIS web servers, and confirm each one against the chosen release before rollout.

windows_exporter repository

A running Prometheus server

The exporter only exposes metrics. Something must scrape them, so a working Prometheus server with its own storage, configuration and reload process needs to be in place first. Confirm which Prometheus version you run and whether it is on a supported release line, because the scrape configuration and TLS options you need later depend on it. Check that the server has enough disk for the retention you intend to keep.

Network path to TCP 9182

windows_exporter listens on TCP port 9182 by default. Confirm that the Prometheus server can reach that port on every monitored host through the host firewall and any network segmentation between subnets, VLANs or security zones. Domain controllers and servers in DMZ segments are often the hardest to open, so raise these with the network and security teams early. Restrict the rule to the Prometheus source addresses only.

Service account and role permissions

Decide which account the exporter service runs under and what it may read. Run it with the least privilege that still allows the collectors you enable, and avoid domain administrator rights. Active Directory, AD FS and IIS collectors read different data, so list the permissions each role needs and have the directory or web administrators approve them in writing. Record the account, its scope and its password or managed account policy in your identity inventory.

Certificate plan if TLS is used

Decide early whether the exporter endpoint will use TLS and client certificate checks. If it will, plan which certificate authority issues the server certificate, how Prometheus will trust that authority, and who renews the certificate before it expires. Prometheus supports TLS 1.2 as the minimum and client certificate authentication, so the planned design should match those settings. Without TLS, any basic authentication credentials cross the network in cleartext, so do not rely on basic authentication alone.

Prometheus security model

How to install, configure and scrape windows_exporter

This sequence takes a Windows Server host from no metrics endpoint to a scrape target that Prometheus reports as up. Each step ends with a check, so a failure is caught on the host that caused it rather than after the scrape job is live.

  1. Confirm the host and access before installing

    The administrator confirms which Windows Server hosts and roles will be monitored, such as domain controllers, AD FS servers and IIS web servers, and checks that the Prometheus server can reach the host on the exporter port through the firewall. Plan the change with the team that owns the host, because the exporter adds a listening endpoint. Done means you have a written list of hosts, roles and the firewall rule owner, and a test from the Prometheus server confirms the network path is open or the rule request is filed.

  2. Install windows_exporter as a Windows service

    Download the windows_exporter installer from the project's GitHub releases page, using the release your team has approved, and run it on the host with administrator rights. The MSI installer registers the exporter as a Windows service so it starts with the server. Confirm the service exists and is running in the Services console or with Get-Service, and that its start type is automatic. Done means the service shows as Running after a reboot test planned in your change window.

  3. Set the listen port to 9182

    windows_exporter listens on port 9182 by default, so most teams keep that value and only change it when a local standard requires another port. If you do change it, set the same port in the service arguments and in the firewall rule, and record it in your configuration as code so every host matches. Confirm the chosen port with netstat or Get-NetTCPConnection on the host, which should show the exporter process listening on that port. Done means the listening port matches the value in your scrape plan.

  4. Choose collectors with the collectors flag

    The collectors flag takes a comma-separated list of collector names. The special value [defaults] expands to the collectors enabled by default, so you can keep the defaults and add others, for example [defaults],ad,adcs,adfs,iis, using the collector names listed in the project repository for your exporter version. Add collectors only for roles the host actually runs, because each enabled collector adds metrics and load. Record the chosen list in the service arguments and confirm the exporter restarts cleanly. Done means the service starts without errors in the Windows event log.

  5. Confirm the metrics endpoint responds locally

    Before Prometheus is involved, test the endpoint from the host itself. Open a browser or run Invoke-WebRequest against the metrics path on port 9182, using localhost or the server name. A healthy response returns plain-text metrics lines, and you should see metric families for the collectors you enabled, such as IIS or Active Directory entries on the matching roles. Done means the response contains those families. If it returns nothing, check the service state, the collector names and the port before you go further.

  6. Add a scrape job to prometheus.yml

    On the Prometheus server, add a job under scrape_configs with a job_name that identifies the Windows role, and list each host as a target in the form host:9182. Use static_configs for a small fleet, or a service discovery method your estate already uses, and add labels such as role or environment so dashboards and alert rules can filter. Validate the file with promtool check config and reload Prometheus with the method your team has enabled. Done means promtool reports no errors and the configuration reloads.

  7. Verify the target shows as up

    Open the Prometheus web interface and go to Status, then Target health. Each Windows host should appear under the new job with a state of UP and a recent last scrape time. You can also run a query such as up with the job label to confirm a value of 1 for each target. If a target is DOWN, read its error message, which usually points to the firewall, the port or the exporter service. Done means every target in the job is UP and the query returns the expected number of series.

Which collectors to enable for AD DS, AD CS, AD FS and IIS

Domain controllers are where Active Directory Domain Services health shows up first. The AD DS collector exposes directory service counters such as LDAP and replication activity, which help you spot authentication pressure and replication problems before users report sign-in failures. Keep the standard host collectors on these machines as well, since CPU, memory, disk and network saturation on a domain controller affects every client that authenticates against it.

  • Enable the AD DS collector: Add it to the collectors list on domain controllers only, so member servers do not report directory counters they cannot produce.
  • Keep host collectors on: CPU, memory, logical disk and network collectors reveal the resource pressure that slows directory responses.
  • Disable collectors you do not read: Leave out collectors for hardware or services a domain controller does not run, so the scrape carries fewer series.
  • Watch the scrape interval: Directory counters change slowly, so a longer interval than your host scrape is usually enough for them.
  • Restrict the endpoint to monitoring hosts: Port 9182 should accept scrapes only from your Prometheus servers, because domain controllers are high-value targets.

Before rollout, confirm the exact AD DS collector name and the counters it exposes for your windows_exporter release in the repository.

Mapping Windows roles to exporter collectors and Prometheus labels

This table maps each Windows host type to the windows_exporter collector that covers it, the job and instance labels to set, and the contrib dashboards or alert rules to start from. Confirm exact collector names against the release you run, because collector names can change between versions.

Windows role or host typeCollectors to enableLabels and contrib assets to check
General Windows Server hostDefaults, expanded through the collectors flag using [defaults]job set to windows, instance set to host:9182, role label kept to a small fixed set such as dc, adfs, iis, file
Domain controllerActive Directory Domain Services collector, plus defaultsUse a role label of dc. Review contrib dashboards and alert rules for AD Domain Services before adopting them unchanged
Certificate authorityActive Directory Certificate Services collector, plus defaultsUse a role label of ca. Confirm the collector name in your release and match any contrib alert rules to it
AD FS federation serverAD FS collector, plus defaultsUse a role label of adfs. Watch authentication-related series, since AD FS hosts often sit in a sensitive network zone
IIS web serverIIS-related collector where your release provides one, plus defaultsUse a role label of iis. Confirm collector availability first, then check contrib dashboards for IIS panels
Hosts in several environmentsSame collector set across environments, with only the scrape target list changingAdd an environment label such as prod or test from the scrape config, not from exporter output, to keep series counts predictable
Labels to avoidNot applicableDo not label series with user names, process IDs, client IPs or request paths, because these create high cardinality across Windows fleets

Securing the windows_exporter endpoint

The windows_exporter endpoint exposes host, directory and service detail on a fixed port, so it needs the same care as any server listener. The cards below cover who can reach it, which account runs it, which collectors it loads, what the metrics reveal, and how transport security fits with the Prometheus server.

Restrict port 9182 to Prometheus

windows_exporter listens on port 9182 by default. Create a Windows Firewall inbound rule that allows this port only from the IP address or subnet of your Prometheus servers, and block it from workstations and other servers. Where your network supports it, place Windows domain controllers and AD FS hosts in a segment that only the monitoring network can reach. Verify the rule from a host that is not Prometheus, because a rule that looks correct can still allow access through a broader existing rule.

Run the service least-privileged

Check which account the windows_exporter service runs under and avoid local administrator or domain administrator rights. Confirm that the account can read the performance counters and service data it needs, and grant only those rights through your normal group policy. Domain controller hosts need extra care because directory collectors read data that administrators treat as sensitive. Record the account in your configuration standard so that a later change to the service identity is reviewed.

Limit collectors to what you alert on

The collectors flag takes a comma-separated list, and [defaults] expands to the collectors enabled by default. Start from the defaults, then add only the role collectors your dashboards and alert rules need, such as Active Directory Domain Services for domain controllers or IIS for web servers. Every enabled collector adds metrics and reads more of the system, so review the list after each role change. Keep the final list in your configuration management so that reviewers can see what the endpoint exposes.

windows_exporter repository

Protect directory and service detail

Metrics from Active Directory, AD FS and IIS can reveal domain controller health, replication state, certificate services activity and application names. Treat the scrape endpoint as sensitive data, not as harmless numbers. Confirm which labels and metric names leave the host, and restrict who can query the Prometheus server and Grafana, since they hold copies of the same data. Ask your security team whether this telemetry needs the same classification as the directory it describes.

Plan TLS and authentication at the edge

Prometheus supports TLS and client certificate authentication with TLS 1.2 as the minimum, plus HTTP basic authentication with bcrypt-hashed passwords. Basic authentication without TLS exposes credentials in cleartext, so do not rely on it across a network segment. Before deployment, confirm which TLS or authentication options the windows_exporter release in use supports on its own endpoint, and whether a proxy on the Windows host is needed instead. Test the scrape with the same settings Prometheus will use in production.

Prometheus security model

Verify and monitor the exposure

After hardening, test the endpoint from an approved Prometheus server and from a blocked host, and record both results. Review firewall rules and enabled collectors after patching, role changes and server rebuilds, since these events often reset or extend exposure. Watch for scrape failures that may signal a blocked rule rather than a host fault. Keep these checks in your change process so that the hardened state is evidence you can show during an assessment.

Using the bundled dashboards and alert rules safely

Treat the dashboards and alerting rules in the contrib directory of the windows_exporter repository as starting points that must be reviewed before they reach an on-call rotation. The rules were written against generic Windows hosts, so the thresholds for CPU, memory, disk and service states may not match your estate. A domain controller that runs replication and authentication under steady load, an AD FS farm behind a load balancer and an IIS fleet serving bursty traffic each have different normal ranges. Before enabling anything, compare each threshold against several weeks of observed values from your own hosts, decide which rules page a person and which only create a ticket or a dashboard panel, and record who owns each decision. Confirm the exact file names and rule groups in the repository for the version you deploy, since the contrib content can change between releases.

Test every rule before it pages anyone. Load the rule file with promtool check rules and run the PromQL expressions against historical data in the Prometheus expression browser to see how often they would have fired. Then route the test alerts to a non-paging receiver for a defined period. Alertmanager is where grouping, inhibition and silences shape what people actually receive: group related host alerts so a single outage does not produce dozens of pages, use inhibition so a host-down alert suppresses the per-service alerts for that host, and use silences for planned patching windows with an expiry and an owner. Ask your partner or internal team to document the routing tree as code so these settings survive a rebuild.

Plan around retention before you judge a dashboard. Prometheus local storage keeps data for 15 days by default, controlled by the --storage.tsdb.retention.time flag, so a panel set to 90 days will show gaps unless you change retention or ship data to long-term storage. Local storage is also single-node and not replicated, so retention settings alone do not protect history. If your reviews or compliance evidence need longer look-back periods, decide that before rollout and confirm the storage sizing with the people who will run it.

How Prometheus reaches Windows hosts through the firewall

The diagram starts at the Prometheus server, which pulls metrics over HTTP from the windows_exporter on each Windows host on TCP port 9182. The firewall sits between the monitoring segment and the servers as a trust boundary, so the only rule you open should be from the Prometheus server's address to that port. Alertmanager receives alerts from Prometheus, and an optional remote write path can forward samples to long-term storage. Check the firewall rule scope, the exporter's collector list, and whether every Alertmanager instance is reachable.

Prometheus pulls from each Windows host through a firewall rule limited to the exporter port.

Why Windows targets show as down or missing metrics

This table lists the failures that most often leave a Windows target marked down or missing expected series, with the likely cause and the fix for each. Work through the rows in order, since a blocked port or stopped service hides every other symptom. Confirm exact collector names and defaults against the windows_exporter repository for the version you deploy.

SymptomLikely causeFix
Target shows as down, connection refused or timeoutWindows Firewall or a network firewall blocks TCP 9182 between Prometheus and the hostAllow inbound TCP 9182 from the Prometheus server address only, then confirm reachability from that server before changing Prometheus
Target down, no listener on the expected portThe windows_exporter service is stopped, failed to start, or was installed with a different listen portCheck the service state on the host, review the Windows event log, and make the scrape port in Prometheus match the configured listen address
Metrics for a role are absent but the target is upA collector needed for that role is disabled, such as AD FS, Active Directory Domain Services, or IIS, so its series are never exposedEnable the collector in the collectors setting, keeping [defaults] to retain standard collectors, and confirm the metric names in the scrape output
Scrape timeouts on domain controllersHeavy collectors on busy hosts take longer than the scrape timeout, so Prometheus records the target as failedMeasure scrape duration, raise the timeout within the scrape interval, and drop collectors you do not alert on
Series count climbs sharply on some hostsPer-process or per-service collectors create one series per process or service instance, and churn adds new label values over timeEnable process-level collectors only where needed, use relabeling to drop unused series, and review cardinality after each change
Gaps in graphs after a Prometheus restart or outageLocal storage keeps data on one node with default retention of 15 days, and it is not replicated, so an outage or disk loss leaves holesTrack disk use against retention, back up the data directory, and send samples to long-term storage through remote write if history must survive a host failure
Target flaps between up and downIntermittent network path issues, host overload, or a service restarting on a scheduleCompare the exporter service restart times with the flap times and check host CPU and network during those windows

Questions buyers ask about monitoring Windows with Prometheus

Can our in-house team set up windows_exporter on its own?

Yes, a team with Windows administration and Prometheus experience can install windows_exporter, enable collectors and add scrape targets without a partner. The harder part is usually the surrounding work: deciding which roles to watch, reviewing the endpoint's exposure, writing alert rules that page on real problems, and keeping the setup consistent across domain controllers, AD FS and IIS servers. Ask whether your team has someone who owns each of those tasks before deciding. If the answer is no for two or more, an outside review or implementation may be the faster route.

What makes the effort on a Windows monitoring project grow?

Effort grows with four things: the number of server roles in scope, the number of collectors enabled on each host, the security review of the metrics endpoint, and the amount of alert design needed. A domain controller set with Active Directory Domain Services and Certificate Services needs more collector choices and checks than a fleet of general-purpose file servers. Each role also needs its own dashboards and alert thresholds, which are the part most often underestimated. Ask any provider to break its quote down by these four drivers.

What does the work need from our team?

Plan for access, change windows and named role owners before the work starts. The implementer needs administrative access to the target hosts or a supervised way to install the exporter, plus network rules that let Prometheus reach port 9182 on each server. Change windows matter for domain controllers and AD FS farms, where restarts or configuration changes must be scheduled. Each role, such as Active Directory, AD FS or IIS, needs an owner who can confirm which metrics matter and approve alert thresholds.

Does windows_exporter replace our existing Windows monitoring?

Not automatically. windows_exporter feeds Prometheus, so it covers the metrics you enable and the alerts you write, but it does not take over agents, event log collection or tools your organization already uses for compliance evidence. Many teams run it alongside an existing agent for a period, compare alerts, and then decide which tool owns each signal. Confirm with your security and operations leads which current alerts, reports and log sources must keep running during any transition.

How is the cost of Windows monitoring split?

Prometheus itself is licensed under Apache-2.0 and has no paid enterprise edition, so the cost comes from infrastructure, storage and people. Infrastructure covers the Prometheus server, Alertmanager and network paths. Storage depends on how many series you collect and how long you keep them; Prometheus defaults to 15 days of local retention, configurable by time or size, and local storage is not clustered or replicated. People costs cover the one-time build, the security review and the recurring upkeep, including upgrades. Ask for each of these as separate line items in any quote.

Is windows_exporter secure enough to run on domain controllers?

It can be run securely, but the endpoint needs deliberate hardening before it reaches production domain controllers. The exporter listens on port 9182 by default, so restrict that port to the Prometheus server with host and network firewall rules, and avoid enabling collectors you do not need. Review which metrics expose sensitive names or configuration details, and confirm your security team accepts the transport and access model. Treat the endpoint as part of your identity infrastructure, not as a routine metrics port.

Which windows_exporter collectors should we enable first?

Start with the collectors that match the roles you run, rather than enabling everything. The collectors flag takes a comma-separated list, and [defaults] expands to the collectors enabled by default, so you can add role-specific collectors such as Active Directory Domain Services, Active Directory Certificate Services or AD FS on top of that baseline. Check the windows_exporter repository for the current collector names and their resource cost before rollout, and test on a non-production host first.

How DeployOpen scopes and delivers Windows monitoring

DeployOpen plans, builds, documents and supports windows_exporter monitoring inside your own infrastructure, from the collector choices for each Windows role to the alert rules and endpoint protections. Engagements are fixed-scope, so the scope, deliverables and timeline are agreed in writing before work starts.

How we scope

  • Inventory which Windows Server hosts and roles, such as Active Directory, AD FS and IIS, must be monitored and who owns each one.
  • Agree the collector list for each role, including whether the default collectors or a narrower set will be enabled.
  • Confirm the network paths from your Prometheus servers to port 9182 and which firewall or segmentation rules apply.
  • Define which bundled dashboards and alert rules will be adapted, and which alerts must reach your existing on-call channels.

How we build

  • Deploy windows_exporter on the agreed hosts with a service configuration your team can review and reproduce.
  • Write Prometheus scrape configuration and target labels so each role and environment is easy to filter in queries.
  • Test collector output and scrape health on every host class before adding alert rules or dashboards to production.
  • Secure the endpoint with restricted network access and reviewed exporter settings, documented as part of the build.

How we hand over

  • Deliver the written configuration, collector decisions, dashboards and alert rules with the reasoning behind each choice.
  • Provide a runbook covering upgrades of windows_exporter, adding new hosts, and responding to each alert.
  • Walk your operations and platform engineers through the setup so they can change collectors and rules without us.
  • Document the verification results, including which scrapes, alerts and access controls were tested and what remains open.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Support can cover tracking windows_exporter releases, retesting collectors after Windows or role changes, and tuning alert noise.
  • Ask any provider to confirm in writing which Windows and windows_exporter versions they will support and for how long.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.