


Microsoft: Run PS script now if you deleted 'inetpub' on Windows 11, Windows 10
Jun 28, 2025 am 12:59 AMIf you removed the “inetpub” folder that was generated after installing the Windows April 2025 Updates, you must restore it immediately, or your system could remain exposed to potential security vulnerabilities. Microsoft informed Windows Latest that this folder can be recreated by enabling the IIS service, or alternatively, you can use a new PowerShell script released on May 28.
For those unfamiliar, after applying the April 2025 Updates, Windows 11 24H2 and older versions such as Windows 10 created an empty folder named “inetpub.” This folder is usually related to Internet Information Services (IIS), a built-in Windows feature that enables developers to host web applications or websites on Windows 11.
Specifically for Windows 11, Microsoft introduced the directory (C:\inetpub\) with update KB5055523 or newer. As seen in the screenshot above, the folder is empty and shows zero bytes of data in its properties.
When I checked my system settings, I found that IIS wasn’t enabled either. Unfortunately, since Microsoft did not explicitly mention that the creation of the “inetpub” folder was intentional in their release notes, some users assumed it was a bug from the cumulative update and proceeded to delete it.
Others removed the folder due to concerns about Microsoft’s approach—particularly the act of creating a folder to fix an OS vulnerability when it can be easily deleted, raising questions about the nature of the patch itself.
Later, Microsoft updated their documentation and clarified to Windows Latest that the “inetpub” folder was created as part of a security fix for CVE-2025-21204, and whether IIS is active or not doesn’t matter—it will still appear. Users are advised not to delete it, and if they already did, they should restore it immediately.
Microsoft explained: “The CVE-2025-21204 vulnerability arises from improper handling of symbolic links before file access (‘link following’) within the Windows Update Stack. On unpatched systems, this flaw could allow local attackers to trick the system into accessing or modifying unintended files or folders.”
Earlier, Microsoft had told Windows Latest that the “inetpub” folder could be recreated with the same level of security by enabling Internet Information Services (IIS) via Control Panel > Programs > Programs & Features > Turn Windows features on or off.
However, most users aren’t keen on turning on IIS because it creates additional folders that aren't needed unless you're a developer.
Windows Latest recently discovered that there's now a PowerShell script available that recreates the folder without requiring IIS to be enabled.
Microsoft published this script on May 28, and here's how to use it.
How to use PowerShell script to restore “inetpub” and patch CVE-2025-21204?
- Launch PowerShell as Administrator—this is essential because modifying folder ACLs and installing modules require admin rights.
- In PowerShell, first allow signed scripts and modules from Microsoft’s PowerShell Gallery using this command: Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
- To download the script from the PowerShell Gallery, run this command: Install-Script -Name Set-InetpubFolderAcl -Force
- In certain cases (like mine), you might be prompted to install the “NuGet Provider” if it’s missing. Simply respond with “Y” and then rerun the “install-script” command.
- Run “Set-InetpubFolderAcl” to apply the fix and recreate the folder. If you encounter a “command not found” error, execute it using the full path: ```
& "C:\Program Files\WindowsPowerShell\Scripts\Set-InetpubFolderAcl.ps1"
<code></code>
How does Install-Script command work?
As noted by Windows Latest, the Install-Script command downloads the .ps1 script file into your local PowerShell Scripts folder (typically C:\Program Files\WindowsPowerShell\Scripts). The fourth step is necessary to actually execute the script. You should definitely consider restoring the “inetpub” folder. According to Microsoft, failing to have this folder and its correct ACLs (Access Control Lists) leaves your system vulnerable to privilege escalation or unauthorized access.
By running the Set-InetpubFolderAcl.ps1 script mentioned above, you are recreating the folder and setting up the appropriate IIS-style permissions so that the security patch for CVE-2025-21204 included in the April 2025 Update becomes effective.
Got any questions? Feel free to leave them in the comments below.
The above is the detailed content of Microsoft: Run PS script now if you deleted 'inetpub' on Windows 11, Windows 10. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

If you're having trouble reading your desktop icons' text or simply want to personalize your desktop look, you may be looking for a way to change the font color on desktop icons in Windows 11. Unfortunately, Windows 11 doesn't offer an easy built-in

Fixed Windows 11 Google Chrome not opening Google Chrome is the most popular browser right now, but even it sometimes requires help to open on Windows. Then follow the on-screen instructions to complete the process. After completing the above steps, launch Google Chrome again to see if it works properly now. 5. Delete Chrome User Profile If you are still having problems, it may be time to delete Chrome User Profile. This will delete all your personal information, so be sure to back up all relevant data. Typically, you delete the Chrome user profile through the browser itself. But given that you can't open it, here's another way: Turn on Windo

When Windows cannot detect a second monitor, first check whether the physical connection is normal, including power supply, cable plug-in and interface compatibility, and try to replace the cable or adapter; secondly, update or reinstall the graphics card driver through the Device Manager, and roll back the driver version if necessary; then manually click "Detection" in the display settings to identify the monitor to confirm whether it is correctly identified by the system; finally check whether the monitor input source is switched to the corresponding interface, and confirm whether the graphics card output port connected to the cable is correct. Following the above steps to check in turn, most dual-screen recognition problems can usually be solved.

Mini PCs have undergone

Have problems uploading files in Google Chrome? This may be annoying, right? Whether you are attaching documents to emails, sharing images on social media, or submitting important files for work or school, a smooth file upload process is crucial. So, it can be frustrating if your file uploads continue to fail in Chrome on Windows PC. If you're not ready to give up your favorite browser, here are some tips for fixes that can't upload files on Windows Google Chrome 1. Start with Universal Repair Before we learn about any advanced troubleshooting tips, it's best to try some of the basic solutions mentioned below. Troubleshooting Internet connection issues: Internet connection

When encountering the problem of printing task stuck, clearing the print queue and restarting the PrintSpooler service is an effective solution. First, open the "Device and Printer" interface to find the corresponding printer, right-click the task and select "Cancel" to clear a single task, or click "Cancel all documents" to clear the queue at one time; if the queue is inaccessible, press Win R to enter services.msc to open the service list, find "PrintSpooler" and stop it before starting the service. If necessary, you can manually delete the residual files under the C:\Windows\System32\spool\PRINTERS path to completely solve the problem.

To display file extensions in Windows 11 File Explorer, you can follow the following steps: 1. Open any folder; 2. Click the "View" tab in the top menu bar; 3. Click the "Options" button in the upper right corner; 4. Switch to the "View" tab; 5. Uncheck "Hide extensions for known file types"; 6. Click "OK" to save settings. This setting helps identify file types, improve development efficiency, and troubleshoot problems. If you just want to view the extension temporarily, you can right-click the file and select "Rename" and press the Esc key to exit, and the system settings will not be changed.
