Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Setup

Download the AD scan script from Stoïk Protect and run it in PowerShell on a machine joined to your domain.

Prerequisites

  • Windows version:

    • Windows 10 or later on a workstation

    • Windows Server 2016 or later on a server (must have recent security patches applied)

  • Internet access: outbound HTTPS (port 443), without SSL inspection, to:

    • api.prod.ad-scan.cyber.stoik.io

    • ad-scan-prod-pingcastle-zip.s3.eu-west-1.amazonaws.com

    • ad-scan-prod-reports.s3.eu-west-1.amazonaws.com

  • Enrolled in Active Directory and connected to the domain controller

  • Logged in to a domain administrator account

  • Unsigned script execution allowed:

    • Option A: Set-ExecutionPolicy Unrestricted -Scope LocalMachine

    • Option B: Add the binary file to the ignore list in Defender or a similar solution, then run Set-ExecutionPolicy Bypass -Scope Process and run the script.

  • Script downloaded within the last 24 hours

  • Latest version of PowerShell installed, check with: $PSVersionTable.PSVersion

Running the scan

1

Open AD Scan

Click AD Scan.

2

Download the script

Click Download script.

If the AD scan script does not download, your security settings may be blocking it. Check if the file appears in the Downloads tab of your file explorer. If the problem persists, modify your security settings to allow downloads.

3

Run the script

Run the script in a PowerShell console from an endpoint that meets the prerequisites above.

Re-running the scan

Updating the AD scan is manual: each new run must be initiated manually. The downloaded script is only valid for 24 hours: after this time, you must download it again.

The scan can be rerun as many times as necessary:

  • Under normal operation, we recommend running it monthly.

  • During infrastructure security hardening phases, it can be run more frequently to verify that misconfigurations have been corrected.

A script can be run on several machines during its 24 hours, and downloading a new one does not cancel the previous one. Each run replaces the previous results for the domain it scanned. New results show up a few seconds after the script ends.

Automatic scan with Stoïk MDR

For Stoïk MDR customers on CrowdStrike, Stoïk runs the script once a month through CrowdStrike, on a machine that CrowdStrike identifies as a domain controller. The machine and the date cannot be chosen. The script runs with the domain controller's own account, so it sees everything a Domain Admin sees. For SentinelOne and Microsoft Defender customers, the script must be run manually.

AD Scan > Settings lists the automatic runs and their status. A failed run is not retried before the next month, but you can run the script manually at any time. The most common cause of failure is a domain controller on Windows Server 2016 or older, see "Could not create SSL/TLS secure channel". To stop automatic runs, contact protect@stoik.io.

Deleting leftover files

The script deletes its files when it ends. If files are left behind (for example after a run with -KeepLog or -NoDelete), run this command in a PowerShell opened as administrator, from the folder where you ran the script:

Troubleshooting

If the script fails, see Setup errors. For what the script sends to Stoïk and why it is not signed, see Common questions.

Last updated