Making MSA Account Launch Browser (Edge/Chrome) in IIS with Windows Authentication for Puppeteer

Abstract: Resolve Puppeteer launch failures on IIS with Windows Authentication by configuring the MSA identity, granting browser folder permissions, and disabling sandbox mode.

Created: 2026-09-16 by
To launch Edge or Chrome with Puppeteer on an IIS server using Windows Authentication and a Managed Service Account (MSA), you must configure the application pool to run under that specific identity and ensure the browser executable has explicit read and execute permissions for that account. Additionally, you need to disable the sandbox mode in Puppeteer because the MSA often lacks the necessary privileges to create the required inter-process communication channels within the restricted IIS environment.

Configuring the Application Pool Identity

The foundation of this setup is ensuring that the IIS worker process runs under the context of your Managed Service Account. If the application pool is running under the default IIS AppPool\DefaultAppPool identity, Puppeteer will attempt to spawn browsers using those limited credentials, which frequently leads to permission denied errors or silent failures during headless execution. Navigate to the IIS Manager on your server. In the Connections pane on the left, expand your server node and select Application Pools. Locate the application pool associated with your Puppeteer-based web application. Right-click it and select Advanced Settings.... Scroll down to the Process Model section and find the Identity property. Change this from ApplicationPoolIdentity to Custom Account. Click the [...] button to browse for your MSA. You typically enter the username as YourDomain\YourManagedServiceAccount without needing to provide a password, as MSAs manage their own Kerberos keys automatically. Once set, restart the application pool to apply the changes. This ensures that any child processes spawned by Node.js inherit the security token of the MSA.

Granting File System Permissions

Even with the correct identity, the operating system may block the browser from launching if the service account cannot access the binary files. Browsers like Microsoft Edge and Google Chrome are installed in protected directories such as C:\Program Files (x86)\Microsoft\Edge\Application or C:\Program Files\Google\Chrome\Application. By default, standard users and service accounts do not have full control over these folders. You must grant the MSA at least Read & Execute permissions on the browser's installation directory. Open File Explorer, navigate to the root folder of the browser you intend to use. Right-click the folder and select Properties, then go to the Security tab. Click Edit and then Add. Enter the name of your Managed Service Account and verify it exists. Select the account from the list and check the box for Read & execute, List folder contents, and Read. Apply these changes recursively to all subfolders and files. Without these permissions, the child_process module used by Puppeteer will fail to start the executable silently or throw an immediate access violation error.

Disabling Browser Sandbox Mode

This is the most critical technical adjustment for Puppeteer in server environments. Modern browsers utilize a "sandbox" architecture where renderer processes run with significantly reduced privileges to enhance security. When IIS spawns a browser under an MSA, the account often does not have the right to create the shared memory segments or named pipes required for the sandbox to function correctly. Consequently, the browser crashes immediately upon launch. You can resolve this by instructing Puppeteer to launch the browser with the sandbox disabled. In your Node.js code, when defining the Puppeteer launch arguments, include the flag --no-sandbox. For example:
const browser = await puppeteer.launch({
  headless: true,
  args: [
    '--no-sandbox',
    '--disable-setuid-sandbox'
  ]
});
The --no-sandbox argument tells the browser to skip the creation of the isolated user namespace and shared memory structures that require elevated privileges. The --disable-setuid-sandbox flag further ensures that the browser does not attempt to change its own user ID, which is another common point of failure for service accounts. While disabling the sandbox reduces the security isolation between tabs, it is generally acceptable for internal automation tasks where the risk of cross-site scripting attacks leading to privilege escalation is mitigated by other network and application-level controls.

Handling User Data Directories

Puppeteer requires a dedicated user data directory to store cookies, cache, and session state. By default, it creates this in a temporary location. However, IIS applications sometimes face restrictions when writing to certain temp folders depending on the strictness of the Windows Server configuration. It is best practice to explicitly define a persistent directory for the user data. When launching the browser, specify the userDataDir option:
const browser = await puppeteer.launch({
  userDataDir: 'C:\\PuppeteerUserData\\MyApp',
  args: ['--no-sandbox']
});
Ensure that the MSA has Full Control permissions over this specified directory. If the directory does not exist, Puppeteer will attempt to create it, but pre-creating it and setting the permissions via PowerShell or the GUI prevents race conditions during startup. This also makes debugging easier, as you can inspect the local storage and cookies directly from the file system if the automation behaves unexpectedly.

Related Configuration Considerations

If you encounter issues after implementing these steps, consider reviewing how your server handles external connectivity. Sometimes, network policies restrict the browser from reaching update servers or telemetry endpoints, causing timeouts. You might also want to look into Adding Private key SSL Cert to IIS if your Puppeteer scripts need to interact with internal HTTPS sites that rely on self-signed certificates, as the browser instance launched by Puppeteer will validate these certs independently of the IIS configuration.

Frequently Asked Questions

Why does Puppeteer work locally but fail on IIS?

It fails because the local developer machine usually runs with administrator rights or a standard user profile that has full access to browser sandboxes and temp folders. IIS runs under a highly restricted service account (MSA) that lacks the kernel-level permissions required for sandboxed processes. Disabling the sandbox and adjusting file permissions bridges this gap.

Can I use the default ApplicationPoolIdentity instead of an MSA?

Yes, but you still need to disable the sandbox. The IIS AppPool\DefaultAppPool identity is essentially a virtual account that behaves similarly to a local service account. It faces the same sandbox restrictions as an MSA. Therefore, the --no-sandbox flag is mandatory regardless of whether you use an MSA or the default app pool identity.

How do I debug why the browser is crashing on startup?

Enable verbose logging in Puppeteer by setting the environment variable PUPPETEER_LOG_LEVEL=debug before launching the script. Check the Windows Event Viewer under Applications and Services Logs for .NET Runtime or Node.js errors. Often, the crash log will indicate a specific missing DLL or a permission denied event related to the user data directory.

Is it safe to disable the browser sandbox in production?

For automated testing and scraping tasks that do not handle sensitive user input, the risk is low. However, if your Puppeteer instance is exposed to untrusted URLs, disabling the sandbox increases the attack surface. Always ensure your IIS server is isolated from the public internet and that the MSA has minimal privileges outside of the browser execution requirement.

What should I do if the MSA password expires?

Managed Service Accounts (gMSAs) manage their own passwords automatically and they do not expire in the traditional sense. If you are using a standard Virtual Account, it also manages its own credentials. If you see authentication errors, it is likely due to a group policy refresh issue or a trust relationship problem between the domain controller and the server hosting IIS, rather than a password expiry.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More