Skip to main content

Duo Authentication for Windows Logon Deployment

Summary

This CW Automate script is the Automate implementation of the PowerShell installer Install-DuoAuthForWinLogon. It downloads the latest Duo Authentication for Windows Logon setup directly from Duo, verifies the file’s integrity, and installs it with the configuration you define through Extra Data Fields (EDFs).

The script is designed to:

  • Set up Duo quickly – on first run with Set_Environment = 1, it creates all necessary EDFs and migrates settings from the old DUO EDFs.
  • Keep Duo up‑to‑date – a remote monitor (created automatically for managed machines) checks every hour whether Duo is installed and current. If not, the same script runs again to fix it.
  • Create tickets when things go wrong – if an automated installation attempt fails, a ticket is generated and updated until the issue is resolved. Manual runs do not create tickets.

All installation parameters are taken from the Duo Authentication for Windows Logon knowledge base. The script follows the instructions in that article.

Sample Run

First Run – Environment Setup
To create the EDFs and migrate values from the old Duo fields, run the script once with Set_Environment = 1. You can run it against any online Windows computer.

Set_Environment run

Regular Execution

Regular execution

Dependencies

Global Variables

NameDefaultDescription
DebugFalseSet to True to see detailed informational logs for troubleshooting.
ScriptEngineEnableLoggerFalseSet to True to write final success/failure logs to the Automate script history.

User Parameters

NameExampleRequiredDescription
Set_Environment1Only for the first runCreates all the EDFs in the Duo_Auth section and copies values from the old DUO fields. Run this once before using the solution.

Client‑Level EDFs

These fields are found in the Duo_Auth section of the client settings. They define the default behaviour for all computers under this client unless overridden at the location or computer level.

NameExampleTypeOptionsSectionDescription
DUO_Auth_DeploymentBothDropdownWorkstations · Servers · Both · DisableDuo_AuthReplaces the old Duo Enabled Client checkbox. Determines whether Duo is deployed on workstations, servers, both, or not at all.
DUO_Auth_IKEYDIABCDEFGHIJKLMNOPTextDuo_AuthReplaces the old DUO IKEY. Your Duo integration key (obtained from the Duo Admin Panel). This value is mandatory for installation.
DUO_Auth_SKEYa1b2c3d4e5f6g7h8i9j0…TextDuo_AuthReplaces the old DUO SKEY. Your Duo secret key. Mandatory.
DUO_Auth_HOSTapi-XXXXXXXX.duosecurity.comTextDuo_AuthReplaces the old DUO HOST. Your Duo API hostname. Mandatory.
AUTOPUSH_Svr1Dropdown0 · 1Duo_AuthReplaces DUO - AUTOPUSH - Server. 1 = automatically send a push notification when a server user logs in; 0 = user must manually request a push.
AUTOPUSH_Wks1Dropdown0 · 1Duo_AuthReplaces DUO - AUTOPUSH - Workstation. Same as above, but applies to workstations.
ENABLECERTPINNING_Svr1Dropdown0 · 1Duo_AuthEnables or disables certificate pinning for Duo traffic from servers. 1 = enabled, 0 = disabled. Certificate pinning helps prevent man‑in‑the‑middle attacks.
ENABLECERTPINNING_Wks1Dropdown0 · 1Duo_AuthSame option for workstations.
ENABLEOFFLINE_Svr1Dropdown0 · 1Duo_AuthReplaces DUO - ENABLEOFFLINE - Server. 1 = allow users to authenticate offline (e.g., when Duo’s service is unreachable); 0 = block offline access.
ENABLEOFFLINE_Wks1Dropdown0 · 1Duo_AuthReplaces DUO - ENABLEOFFLINE - Workstation. Same as above for workstations.
FAILOPEN_Svr0Dropdown0 · 1Duo_AuthReplaces DUO - FAILOPEN - Server. 1 = if Duo’s service cannot be reached, allow the user to log in (fail open); 0 = deny access (fail closed).
FAILOPEN_Wks0Dropdown0 · 1Duo_AuthReplaces DUO - FAILOPEN - Workstation. Same as above for workstations.
LOGFILE_MAXCOUNT_Svr10TextDuo_AuthMaximum number of rotated Duo log files to keep on servers. Once exceeded, the oldest file is deleted.
LOGFILE_MAXCOUNT_Wks10TextDuo_AuthSame setting for workstations.
LOGFILE_MAXSIZEMB_Svr50TextDuo_AuthMaximum size (in megabytes) of each rotated log file on servers. When a file reaches this size, it is rotated.
LOGFILE_MAXSIZEMB_Wks50TextDuo_AuthSame setting for workstations.
PROXYHOST_Svrproxy.corp.localTextDuo_AuthHostname or IP address of an upstream HTTP proxy that Duo should use for its API calls from servers. Leave blank if no proxy is needed.
PROXYHOST_Wksproxy.corp.localTextDuo_AuthSame setting for workstations.
PROXYPORT_Svr8080TextDuo_AuthTCP port of the HTTP proxy for servers. Only used if PROXYHOST_Svr is set.
PROXYPORT_Wks8080TextDuo_AuthSame setting for workstations.
RDPONLY_Svr0Dropdown0 · 1Duo_AuthReplaces DUO - RDPONLY - Server. 1 = require Duo authentication only for remote (RDP) logons; 0 = require Duo for both local console and RDP logons.
RDPONLY_Wks0Dropdown0 · 1Duo_AuthReplaces DUO - RDPONLY - Workstation. Same as above for workstations.
SMARTCARD_Svr0Dropdown0 · 1Duo_AuthReplaces DUO - SMARTCARD - Server. 1 = allow smart card login as an alternative to Duo; 0 = disable the Windows smart card provider (users cannot use smart cards).
SMARTCARD_Wks0Dropdown0 · 1Duo_AuthReplaces DUO - SMARTCARD - Workstation. Same as above for workstations.
UAC_OFFLINE_Svr1Dropdown0 · 1Duo_AuthWhen enabled (1), allows offline Duo authentication during User Account Control (UAC) elevation prompts on servers.
UAC_OFFLINE_Wks1Dropdown0 · 1Duo_AuthSame option for workstations.
UAC_OFFLINE_ENROLL_Svr1Dropdown0 · 1Duo_AuthWhen enabled (1), allows a user to enroll for offline access during a UAC elevation prompt on servers.
UAC_OFFLINE_ENROLL_Wks1Dropdown0 · 1Duo_AuthSame option for workstations.
UAC_PROTECTMODE_Svr0Dropdown0 · 1 · 2Duo_AuthControls how Duo interacts with UAC elevation. 0 = respect existing Duo logon rules, 1 = disable Duo at Windows logon and only require it when a program requests elevation, 2 = enforce Duo at both logon and UAC elevation. For servers.
UAC_PROTECTMODE_Wks0Dropdown0 · 1 · 2Duo_AuthSame options for workstations.
USERNAMEFORMAT_Svr1Dropdown0 · 1 · 2Duo_AuthSpecifies the username format sent to Duo from servers. 0 = sAMAccountName (short name), 1 = NTLM format (domain\username), 2 = userPrincipalName (email‑style).
USERNAMEFORMAT_Wks1Dropdown0 · 1 · 2Duo_AuthSame options for workstations.
WRAPSMARTCARD_Svr0Dropdown0 · 1Duo_AuthWhen smart card logon is enabled (SMARTCARD_Svr = 1), this setting determines if Duo is additionally required after the smart card authentication. 1 = require Duo after smart card, 0 = skip Duo. For servers.
WRAPSMARTCARD_Wks0Dropdown0 · 1Duo_AuthSame option for workstations.

Client-Level EDFs

Location‑Level EDFs

These fields, also in Duo_Auth, override the client settings for a specific location. Setting a value here will apply to all computers in that location, unless it is further overridden at the computer level.

NameExampleTypeOptionsSectionDescription
DUO_Auth_DeploymentBothDropdownWorkstations · Servers · Both · DisableDuo_AuthReplaces the old DUO Agent Exclusion checkbox. Overrides the client‑level deployment mode for this location.
DUO_Auth_IKEYDIABCDEFGHIJKLMNOPTextDuo_AuthOverrides the Duo integration key for this location.
DUO_Auth_SKEYa1b2c3d4e5f6g7h8i9j0…TextDuo_AuthOverrides the Duo secret key for this location.
DUO_Auth_HOSTapi-XXXXXXXX.duosecurity.comTextDuo_AuthOverrides the Duo API hostname for this location.
AUTOPUSH_Svr1Dropdown0 · 1Duo_AuthOverrides the automatic push setting for servers in this location. 1 = auto‑send push, 0 = manual.
AUTOPUSH_Wks1Dropdown0 · 1Duo_AuthOverrides the automatic push setting for workstations in this location.
ENABLECERTPINNING_Svr1Dropdown0 · 1Duo_AuthOverrides certificate pinning for servers in this location. 1 = enabled, 0 = disabled.
ENABLECERTPINNING_Wks1Dropdown0 · 1Duo_AuthOverrides certificate pinning for workstations in this location.
ENABLEOFFLINE_Svr1Dropdown0 · 1Duo_AuthOverrides offline access for servers in this location. 1 = allow, 0 = block.
ENABLEOFFLINE_Wks1Dropdown0 · 1Duo_AuthOverrides offline access for workstations in this location.
FAILOPEN_Svr0Dropdown0 · 1Duo_AuthOverrides fail‑open mode for servers in this location. 1 = allow login if Duo unreachable, 0 = deny.
FAILOPEN_Wks0Dropdown0 · 1Duo_AuthOverrides fail‑open mode for workstations in this location.
LOGFILE_MAXCOUNT_Svr10TextDuo_AuthOverrides the maximum number of rotated log files for servers in this location.
LOGFILE_MAXCOUNT_Wks10TextDuo_AuthOverrides the maximum number of rotated log files for workstations in this location.
LOGFILE_MAXSIZEMB_Svr50TextDuo_AuthOverrides the maximum log file size (MB) for servers in this location.
LOGFILE_MAXSIZEMB_Wks50TextDuo_AuthOverrides the maximum log file size (MB) for workstations in this location.
PROXYHOST_Svrproxy.corp.localTextDuo_AuthOverrides the proxy hostname for Duo traffic from servers in this location.
PROXYHOST_Wksproxy.corp.localTextDuo_AuthOverrides the proxy hostname for Duo traffic from workstations in this location.
PROXYPORT_Svr8080TextDuo_AuthOverrides the proxy port for servers in this location.
PROXYPORT_Wks8080TextDuo_AuthOverrides the proxy port for workstations in this location.
RDPONLY_Svr0Dropdown0 · 1Duo_AuthOverrides RDP‑only protection for servers in this location. 1 = RDP only, 0 = local + RDP.
RDPONLY_Wks0Dropdown0 · 1Duo_AuthOverrides RDP‑only protection for workstations in this location.
SMARTCARD_Svr0Dropdown0 · 1Duo_AuthOverrides smart card alternative for servers in this location. 1 = allow, 0 = disable.
SMARTCARD_Wks0Dropdown0 · 1Duo_AuthOverrides smart card alternative for workstations in this location.
UAC_OFFLINE_Svr1Dropdown0 · 1Duo_AuthOverrides offline access during UAC elevation for servers in this location.
UAC_OFFLINE_Wks1Dropdown0 · 1Duo_AuthOverrides offline access during UAC elevation for workstations in this location.
UAC_OFFLINE_ENROLL_Svr1Dropdown0 · 1Duo_AuthOverrides offline enrollment during UAC elevation for servers in this location.
UAC_OFFLINE_ENROLL_Wks1Dropdown0 · 1Duo_AuthOverrides offline enrollment during UAC elevation for workstations in this location.
UAC_PROTECTMODE_Svr0Dropdown0 · 1 · 2Duo_AuthOverrides UAC protection mode for servers. 0 = respect logon rules, 1 = UAC only, 2 = both.
UAC_PROTECTMODE_Wks0Dropdown0 · 1 · 2Duo_AuthOverrides UAC protection mode for workstations.
USERNAMEFORMAT_Svr1Dropdown0 · 1 · 2Duo_AuthOverrides the username format sent to Duo from servers. 0 = sAM, 1 = domain\user, 2 = UPN.
USERNAMEFORMAT_Wks1Dropdown0 · 1 · 2Duo_AuthOverrides the username format for workstations.
WRAPSMARTCARD_Svr0Dropdown0 · 1Duo_AuthOverrides whether Duo is required after smart card logon on servers. 1 = require Duo, 0 = skip.
WRAPSMARTCARD_Wks0Dropdown0 · 1Duo_AuthOverrides the same for workstations.

Location-Level EDFs

Computer‑Level EDFs

Computer overrides are also in Duo_Auth. They use the same names as the client EDFs but without the _Svr or _Wks suffix – the script automatically picks the right setting based on the computer’s operating system.

NameExampleTypeOptionsSectionDescription
DUO_Auth_DeploymentDisableDropdownWorkstations · Servers · Both · DisableDuo_AuthReplaces the old Duo Agent Exclusion computer checkbox. Overrides the deployment mode for this specific computer.
DUO_Auth_IKEYTextDuo_AuthOverrides the integration key for this machine.
DUO_Auth_SKEYTextDuo_AuthOverrides the secret key.
DUO_Auth_HOSTTextDuo_AuthOverrides the API hostname.
AUTOPUSH0Dropdown0 · 1Duo_AuthReplaces the old DUO - AUTOPUSH computer override. 1 = auto‑send push, 0 = manual push.
ENABLECERTPINNING1Dropdown0 · 1Duo_AuthOverrides certificate pinning setting for this computer.
ENABLEOFFLINE1Dropdown0 · 1Duo_AuthReplaces DUO - ENABLEOFFLINE. 1 = allow offline access, 0 = block.
FAILOPEN0Dropdown0 · 1Duo_AuthReplaces DUO - FAILOPEN. 1 = fail open, 0 = fail closed.
RDPONLY0Dropdown0 · 1Duo_AuthReplaces DUO - RDPONLY. 1 = RDP only, 0 = local + RDP.
SMARTCARD0Dropdown0 · 1Duo_AuthReplaces DUO - SMARTCARD. 1 = allow smart cards, 0 = disable.
UAC_OFFLINE1Dropdown0 · 1Duo_AuthOverrides offline access for UAC elevation on this computer.
UAC_OFFLINE_ENROLL1Dropdown0 · 1Duo_AuthOverrides offline enrollment during UAC elevation.
UAC_PROTECTMODE0Dropdown0 · 1 · 2Duo_AuthOverrides UAC protection mode. See client‑level description for meaning of each value.
USERNAMEFORMAT1Dropdown0 · 1 · 2Duo_AuthOverrides the username format for this computer.
WRAPSMARTCARD0Dropdown0 · 1Duo_AuthOverrides whether Duo is required after smart card logon.
LOGFILE_MAXCOUNTTextDuo_AuthOverrides the maximum number of rotated log files.
LOGFILE_MAXSIZEMBTextDuo_AuthOverrides the maximum log file size.
PROXYHOSTTextDuo_AuthOverrides the proxy hostname.
PROXYPORTTextDuo_AuthOverrides the proxy port.

Computer-Level EDFs

Output

Installation
Duo Authentication for Windows Logon is installed silently. After a successful run, you will find the application in Programs and Features as “Duo Authentication for Windows Logon”.

Logs
All actions are logged by the PowerShell script. The logs are saved in the same folder where the script runs and are named:

  • Install-DuoAuthForWinLogon-log.txt
  • Install-DuoAuthForWinLogon-error.txt

Remote Monitor
When the script is triggered by the internal monitor (i.e., automatically for a managed computer), it also creates a remote monitor called Duo Authentication for Windows Logon Version Check. This monitor runs every hour and checks:

  • Is Duo installed?
  • Is it the latest version?

If the answer to either question is “no”, the monitor returns a failure message (for example, Failure: Not Installed). That failure triggers the alert template △ Custom - Execute Script - Duo Authentication for Windows Logon Deployment, which immediately runs this script again to fix the problem.

The remote monitor is not created when you run the script manually. It is only placed on computers that are part of the automated deployment (i.e., where the internal monitor decided to run the script).

Ticketing

  • When a ticket is created – If the script fails while being run by the internal monitor or the remote monitor (i.e., automatically), a ticket is opened automatically.
  • Ticket subjectDUO Authentication for Windows Logon Install/Update Failed on %ComputerName% at %ClientName%
  • Consecutive failures – If the script fails again on the same machine, a new comment is added to the existing open ticket rather than creating a duplicate ticket.
  • Automatic closure – When a later run of the script succeeds, the ticket is automatically closed.

Manual runs of the script (not triggered by a monitor) will never create or modify tickets.

Changelog

2026-07-08

  • Initial version of the document.
  • New script replaces the old DUO Install & Upgrade - Latest Version.
  • Introduced the Duo_Auth EDF section with separate fields for servers and workstations.
  • Added automatic migration of settings from the old Duo EDFs.
  • Added the Duo Authentication for Windows Logon Version Check remote monitor.
  • Implemented automatic ticket creation, comment appending, and closure.