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

Setup errors

Fix the most common errors printed by the Active Directory scan script when it fails.

Reading the script output

Most errors come from an endpoint (workstation or server) that does not meet the prerequisites. The script output says which one:

  • The script runs 10 numbered checks and prints OK or NOK for each, then a Mandatory issues summary. The NOK line usually says what to fix.

  • If the window closed, open the log file C:\Temp\Stoik\Stoik_ADScan_<date>.log. It is kept when the run fails.

Troubleshooting

"Script download age: NOK", "Token expired" or "400 Bad Request"

The script is more than 24 hours old (check 5 shows its age in hours). Download a new one from Stoïk Protect.

"Domain-joined: NOK"

The machine is not part of the domain (a server in a workgroup, a personal laptop). Use a domain-joined machine.

If you have no on-premise Active Directory at all (Entra ID only), the AD scan does not apply: use the Cloud scan.

"Could not create SSL/TLS secure channel"

The Stoïk API only accepts TLS 1.2 and 1.3 with recent ciphers. Two usual causes:

  • Old Windows: Windows Server 2012 and many Windows Server 2016 machines do not offer these ciphers. The easiest fix is to run the script from a more recent domain-joined machine. It does not have to be the domain controller.

  • SSL inspection on your proxy or firewall: see PingCastle cannot be downloaded or the report cannot be uploaded.

On Windows Server 2016, you can also enable the ciphers from a PowerShell opened as administrator, then run the script again:

"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" | ForEach-Object { Enable-TlsCipherSuite -Name $_ }
The script closes automatically after execution

This means that script execution is restricted on the terminal. Here is a three-step solution:

  1. Download the script and go to Downloads, then type powershell -ep bypass in the search bar:

  2. The PowerShell console should open automatically. Once it has opened, type & '.\ then press Tab until the correct script file is visible:

  3. Press Enter.

PingCastle cannot be downloaded or the report cannot be uploaded

The machine must reach the three hosts listed in the prerequisites over HTTPS, without SSL inspection. A proxy that inspects HTTPS traffic to the S3 buckets breaks the download link, even when DNS and TCP connectivity look fine. If that is already done:

  • The PingCastle.exe download stalls, then fails with 403 (or the config file downloads but not the .exe): a web filter blocks executable files. PingCastle.exe is about 230 MB.

  • "Upload failed for ad_hc_….xml" (403 or "Unable to connect"): the firewall blocks uploads to the reports host. If only the .html upload failed, results show up but the report cannot be downloaded.

  • Downloading in a browser works, the script does not: the proxy treats PowerShell traffic differently, usually because of SSL inspection.

  • You go through a proxy: the script uses the Windows proxy settings. To force one, run it with -Proxy "http://proxy:8080".

To test from the same machine, this command must answer {"status":"ok"}:

"PingCastle has stopped working" or "No report files found"

PingCastle is an Active Directory audit tool, so antiviruses often flag it (for example as Riskware.PingCastle). Other signs: PingCastle stops with an exit code, or a check mentions that the antivirus may have deleted a file.

  • Exclude the script, PingCastle.exe and the C:\Temp\Stoik folder, or pause the EDR during the scan.

  • If your EDR is managed by Stoïk MDR, contact protect@stoik.io.

  • To help Stoïk investigate, run the script again with -PCDebug -KeepLog -NoDelete and send the logs to protect@stoik.io.

Last updated