Solution
The Access Denied error when running
Steps to Fix
iisreset, despite being an Enterprise Admin and part of the local Administrators group, typically occurs due to elevated permission mismatches, misconfigured UAC policies, or service-specific restrictions. Here's how you can resolve this and regain proper control over IIS.Steps to Fix iisreset Access Denied and Permissions Issues
Step 1: Force Elevated CMD
Even though you ran the Command Prompt as Administrator, it’s possible it wasn’t fully elevated due to UAC or context issues.- Explicitly Run CMD as Administrator:
- Press Win + S, search for Command Prompt, right-click it...
- Joined
- Mar 14, 2023
- Messages
- 100,424
The
Steps to Resolve Access Denied for
ERROR (hresult:80070005, message: Command execution failed Access is denied) from the appcmd restore backup command usually indicates permission issues, even though you’re running CMD as an administrator. This could happen due to:- Misconfigured Permissions on the backup directory or IIS configuration files.
- IIS-related services not having sufficient access.
- A corrupted IIS configuration or locked files preventing restoration.
Steps to Resolve Access Denied for appcmd restore backup
Step 1: Verify Backup Directory Permissions
The IIS backups are stored in the following location by default:
Code:
%windir%\System32\inetsrv\backup
- Check Permissions on the Backup Folder:
- Navigate to:
Code:C:\Windows\System32\inetsrv\backup - Right-click the folder, select Properties > Security tab.
- Ensure the following accounts have Read/Write access:
- Administrators
- SYSTEM
- Navigate to:
- Explicitly Grant Permissions if Needed:
- Add your user account or
Administratorsmanually:- Click Edit > Add... > Enter your admin username or
Administrators. - Grant Full Control to the folder.
- Click Edit > Add... > Enter your admin username or
- Add your user account or
Step 2: Ensure Elevated Admin Privileges
Even when running CMD as Admin, you may need to explicitly elevate permissions for theappcmd command.- Force elevated CMD mode:
- Search for Command Prompt, right-click it, and select Run as Administrator (again).
- Attempt the Command Again:
Code:bash appcmd restore backup "backupname"
Step 3: Verify that IIS Services Are Running
If IIS services are stopped or misconfigured,appcmd might fail.- Check IIS service status:
Code:bash net start W3SVC net start WAS - If services are stopped, start them manually using the above commands.
Step 4: Bypass UAC (As a Test)
Windows User Account Control (UAC) could interfere with permissions.- Temporarily disable UAC:
- Open Control Panel > User Accounts > Change User Account Control Settings.
- Lower the slider to Never notify.
- Reboot the server (if prompted).
- Retry the
appcmd restore backupcommand:
Code:bash appcmd restore backup "backupname" - Re-enable UAC after testing.
Step 5: Confirm Integrity of the Backup
If the backup files themselves are incomplete or corrupted, the restore may fail.- Inspect the Backup Folder:
- Navigate to:
Code:C:\Windows\System32\inetsrv\backup\<backupname> - Ensure the backup folder contains the required files, including:
applicationHost.configmetaBase.xml(if IIS 6 compatibility is enabled).
- Navigate to:
- If the Backup is Corrupt:
- Try another backup file from the directory (test restoring a different backup using the same command).
Step 6: Run appcmd Restore via Safe Mode
If permissions issues or file locking persist, boot into Safe Mode to minimize interference with files or services.- Reboot into Safe Mode:
- On reboot, press F8 repeatedly (or Shift+F8).
- Choose Safe Mode with Networking.
- Restore Backup in Safe Mode:
- Try the command again in Safe Mode:
Code:bash appcmd restore backup "backupname"
- Try the command again in Safe Mode:
- Reboot into normal mode once the restore is complete.
Step 7: Check System Logs for IIS Errors
If the issue persists, error logs might reveal the underlying cause.- Open Event Viewer:
- Check Windows Logs > System or Applications and Service Logs > IIS-Configuration for errors around the time of the failed restore.
- Look for Specific Errors:
- File locking, missing privileges, or mismatched metadata errors related to IIS or
appcmd.
- File locking, missing privileges, or mismatched metadata errors related to IIS or
Step 8: Elevated Manual Restore
If all else fails, you can restore the configuration manually.- Navigate to the backup folder:
Code:C:\Windows\System32\inetsrv\backup\<backupname> - Replace Current IIS Configuration:
- Backup the current
applicationHost.config:
Code:C:\Windows\System32\inetsrv\config\applicationHost.config - Replace it with the backed-up version from
<backupname>.
- Backup the current
- Restart IIS:
Code:bash iisreset
Let Me Know!
- Share any new output/error messages or results from the above steps, and I’ll assist further!
- We're close to resolving this!
- Thread Author
-
- #3
When attempting to do iisreset I get
Attempting stop...
Restart attempt failed.
Access denied, you must be an administrator of the remote computer to use this
command. Either have your account added to the administrator local group of
the remote computer or to the domain administrator global group.
Ran cmd as administrator. User is and Enterprise Admin and is part of the Local administrators group.
Attempting stop...
Restart attempt failed.
Access denied, you must be an administrator of the remote computer to use this
command. Either have your account added to the administrator local group of
the remote computer or to the domain administrator global group.
Ran cmd as administrator. User is and Enterprise Admin and is part of the Local administrators group.
- Joined
- Mar 14, 2023
- Messages
- 100,424
The Access Denied error when running
Steps to Fix
iisreset, despite being an Enterprise Admin and part of the local Administrators group, typically occurs due to elevated permission mismatches, misconfigured UAC policies, or service-specific restrictions. Here's how you can resolve this and regain proper control over IIS.Steps to Fix iisreset Access Denied and Permissions Issues
Step 1: Force Elevated CMD
Even though you ran the Command Prompt as Administrator, it’s possible it wasn’t fully elevated due to UAC or context issues.- Explicitly Run CMD as Administrator:
- Press Win + S, search for Command Prompt, right-click it, and select Run as Administrator.
- Ensure UAC is Not Blocking Elevated Access:
- Open Control Panel > User Accounts > Change User Account Control settings.
- Lower the slider to Never notify (temporarily).
- Reboot if prompted and test again with:
Code:bash iisreset
Step 2: Verify Membership in the IIS Admin Group
Certain IIS commands, such asiisreset, also depend on privileges specific to IIS Admin access.- Ensure the user account is added to the following Administrators local group:
- Open Computer Management:
Code:bash compmgmt.msc - Navigate to:
Code:Local Users and Groups > Groups > Administrators - Confirm your user account is listed.
- Open Computer Management:
- If IIS-specific permissions are needed:
- Ensure the account has ownership and control over IIS directories:
Code:C:\Windows\System32\inetsrv C:\inetpub
- Ensure the account has ownership and control over IIS directories:
Step 3: Add User to the IIS Admin Service Group
Theiisreset command interacts directly with the Windows Process Activation Service (WAS) and other IIS services. Permissions to control these services are sometimes bound to the IIS_IUSRS group.- Add your account to IIS_IUSRS:
- Open Command Prompt as Administrator:
Code:bash net localgroup IIS_IUSRS <YourUsername> /add
- Open Command Prompt as Administrator:
- Retry
iisreset:
Code:bash iisreset
Step 4: Verify IIS Services Status
If an IIS-related service (e.g., WAS, W3SVC) isn't starting or is misconfigured,iisreset might fail.- List the status of IIS-related services:
Code:bash net start- Check services like:
World Wide Web Publishing Service (W3SVC)Windows Process Activation Service (WAS)
- Check services like:
- Manually start the required services:
Code:bash net start W3SVC net start WAS - Retry
iisreset.
Step 5: Temporarily Disable Remote Permissions Enforcement
If the server believes you’re running the command remotely (even on the local machine), there may be a misread context due to a security policy.- Temporarily disable remote restrictions:
- Open Local Security Policy (
secpol.msc). - Navigate to:
Code:Security Settings > Local Policies > Security Options - Locate:
- User Account Control: Run all administrators in Admin Approval Mode.
- User Account Control: Admin Approval Mode for the Built-in Administrator Account.
- Disable both.
- Open Local Security Policy (
- Reboot the server and retry
iisreset. - Re-enable UAC after troubleshooting.
Step 6: Reset IIS Configuration
Permissions issues may also arise from corrupt IIS configuration.- Backup Existing Configuration:
- Navigate to:
Code:C:\Windows\System32\inetsrv\config - Copy and save the file
applicationHost.configto a backup location.
- Navigate to:
- Restore IIS Configuration:
- Restore the IIS backup via:
0Code:bash compmgmt.msc
- Restore the IIS backup via:
Step 7: Repair Windows Components
Corruption in Windows services or components could prevent proper service startup.- Run Component Store Cleanup:
1Code:bash compmgmt.msc - Restart the server and retry the commands after completion.
Step 8: Check Event Viewer for Further Clues
Review Windows logs for permission-related issues duringiisreset.- Open Event Viewer (
eventvwr.msc).- Navigate to:
2Code:bash compmgmt.msc - Look for errors or warnings related to IIS, WAS, or services.
- Navigate to:
- Address any errors or failures logged.
If All Else Fails: Rebuild IIS Configuration
If unresolved, IIS may require a clean slate:- Uninstall and Reinstall IIS:
- Remove IIS:
3Code:bash compmgmt.msc - Reinstall IIS:
4Code:bash compmgmt.msc
- Remove IIS:
- Restore configuration from backups.
Let Me Know
Test these steps (starting from UAC and permissions adjustments) and let me know how it goes! Ifiisreset or appcmd still fails, additional logs or error codes will help refine the solution.
Solution
- Joined
- Mar 14, 2023
- Messages
- 100,424
That’s a great observation! Using the
By explicitly adding the
Why
Step 2: Verify
If
Let me know if the solution fully resolved the issue or if additional help is needed—I’m glad you found that useful workaround!
iisreset /stop /timeout:60 command is a workaround for IIS 7's known quirks where the standard iisreset command may hang or fail due to delayed stopping of dependent services such as WAS or W3SVC.By explicitly adding the
/timeout flag, the command waits appropriately for services to stop before reporting success or failure. IIS 7 sometimes times out prematurely, causing issues like errors or Access Denied.Why /timeout:60 Works
- Extended Grace Period:
- The timeout parameter gives additional time for services like Windows Process Activation Service (WAS), W3SVC, or custom app pools to gracefully stop.
- Without
/timeout, these services might still be shutting down when the system assumes failure.
- Prevents "Access Denied":
- Delayed services might interfere with stop/start operations when improperly terminated.
- The added timeout clears processes locked by services.
Steps to Fully Resolve IIS Issues
Now thatiisreset /stop /timeout:60 works, here’s what you can do to ensure IIS runs smoothly moving forward:Step 1: Verify IIS Service Behavior
Check if all IIS services stop/start properly without further intervention.- List Running Services:
Code:bash net start- Look for:
W3SVC(World Wide Web Publishing Service)WAS(Windows Process Activation Service)
- Look for:
- Test Manually Stopping IIS:
Code:bash net stop W3SVC net stop WAS - Restart Services After Testing:
Code:bash net start WAS net start W3SVC
Step 2: Verify iisreset Command Timing
If /timeout is still needed for iisreset, you can add it to your working process to ensure stability:- Stop IIS with Timeout:
Code:bash iisreset /stop /timeout:60 - Start IIS:
Code:bash iisreset /start - Restart Entirely:
Code:bash iisreset /restart /timeout:60
Step 3: Check for Underlying Delays
Long service shutdown/start times could be caused by resource contention or IIS configuration issues (e.g., application pool timeout settings).- Check Application Pool Behavior:
- Open IIS Manager > Application Pools.
- Look for app pools with Stopped or Error states.
- Set all app pools to Recycle Automatically:
- Right-click the application pool > Select Recycling... > Configure settings.
- Investigate Event Viewer:
- Open Event Viewer (
eventvwr.msc). - Check Windows Logs > System or Applications and Service Logs > IIS-Configuration for errors.
- Open Event Viewer (
Step 4: Cleanup Configuration if Needed
If the above steps indicate lingering issues, clean and refresh IIS:- Run DISM to repair system components:
Code:bash dism /online /cleanup-image /restorehealth - Test configuration restore for IIS backups using:
Code:bash appcmd restore backup "backupname"
Let me know if the solution fully resolved the issue or if additional help is needed—I’m glad you found that useful workaround!
- Joined
- Mar 14, 2023
- Messages
- 100,424
If you can backup IIS successfully but still get an "Access Denied" error when attempting
Let’s resolve this step-by-step to ensure restoration works:
Steps to Resolve "Access Denied" for
appcmd restore backup, this means the read permissions during restoration (which involve overwriting existing IIS configuration files) are limited or blocked. This discrepancy between backing up and restoring usually occurs due to restricted write permissions or locked configuration files.Let’s resolve this step-by-step to ensure restoration works:
Steps to Resolve "Access Denied" for appcmd restore backup
Step 1: Verify Permissions for the Backup Folder
Restoring a backup involves overwriting key IIS config files likeapplicationHost.config in its system location. Improper folder or file permissions are a common cause of issues.- Navigate to the IIS Config Backup Folder:
Code:C:\Windows\System32\inetsrv\backup - Check the Folder and File Permissions:
- Folder (
backup):- Right-click and select Properties > Security.
- Verify the following accounts have Full Control:
- Administrators
- SYSTEM
- If not present, add these accounts and grant Full Control.
- Files within Backup Folder (
applicationHost.config, etc.:- Open the backup folder (e.g.,
C:\Windows\System32\inetsrv\backup\YourBackupName). - Repeat the same permission steps for the actual content files.
- Open the backup folder (e.g.,
- Folder (
- Retry the Restore Command:
Code:bash appcmd restore backup "backupname"
Step 2: Ensure Elevated Admin Privileges (Re-check Context)
Even if running Command Prompt as an administrator,appcmd may encounter access issues due to UAC or service-level permissions.- Launch Truly Elevated Command Prompt:
- Search for Command Prompt > Right-click > Run as Administrator (again).
- Type:
Code:bash appcmd restore backup "backupname"
Step 3: Stop IIS Services Before Restore
Active IIS services or locked configuration files may block overwrite attempts during restoration.- Stop IIS Services:
Code:bash net stop W3SVC net stop WAS - Retry Restoration:
Code:bash appcmd restore backup "backupname" - Start IIS Services Again Once Restored:
Code:bash net start WAS net start W3SVC
Step 4: Temporarily Disable UAC
If User Account Control (UAC) is interfering, temporarily disable it to restore IIS.- Adjust UAC Settings:
- Open Control Panel > User Accounts > Change User Account Control Settings.
- Move the slider to Never Notify.
- Retry the Restoration Command:
Code:bash appcmd restore backup "backupname" - Reboot and Re-enable UAC Afterwards (Important).
Step 5: Manually Restore a Backup
Ifappcmd restore backup continues to fail, manually override and replace the IIS configuration files from the backup.- Navigate to The Backup Location:
- Example:
Code:C:\Windows\System32\inetsrv\backup\YourBackupName\
- Example:
- Backup the Current IIS Configuration:
- Before overwriting, save the current config:
Code:C:\Windows\System32\inetsrv\Config\applicationHost.config - Copy it to a safe location for later recovery purposes.
- Before overwriting, save the current config:
- Overwrite IIS Config Files:
- Copy the following files from your backup folder and overwrite the originals:
Path to overwrite:Code:applicationHost.config
0Code:bash appcmd restore backup "backupname"
- Copy the following files from your backup folder and overwrite the originals:
- Restart IIS:
1Code:bash appcmd restore backup "backupname"
Step 6: Investigate Event Viewer for Clues
If errors continue, Windows logs may provide insights into what's blocking the restoration.- Open Event Viewer (
eventvwr.msc).- Check logs under:
2Code:bash appcmd restore backup "backupname"
- Check logs under:
- Look specifically for:
- Errors related to file permissions, IIS services, or locked config files.
Optional Step 7: Repair IIS
If none of the above works, reset IIS’s configuration entirely before attempting restoration.- Backup the Current Config:
3Code:bash appcmd restore backup "backupname" - Reinstall IIS:
- Uninstall IIS:
4Code:bash appcmd restore backup "backupname" - Reinstall IIS:
5Code:bash appcmd restore backup "backupname"
- Uninstall IIS:
- Restore the Original Config:
- Use
appcmd:
6Code:bash appcmd restore backup "backupname"
- Use
Summary
The most likely root cause of Access Denied errors during restoration is insufficient permissions or locked files. The advised steps (permissions check, manually restoring config files, and stopping IIS services) should resolve these issues. Let me know how it goes and if additional errors or roadblocks appear—I’ll guide further!- Joined
- Mar 14, 2023
- Messages
- 100,424
If attempting to restore the IIS configuration using
Let’s fix your IIS restore process step-by-step while investigating why W3SVC is being terminated.
appcmd restore backup causes the World Wide Web Publishing Service (W3SVC) to stop, it indicates a deeper configuration conflict or corruption during the restoration process. The service abruptly stopping suggests that the restored configuration might have invalid elements or permissions issues, which ISAPI filters, custom modules, or corrupt applicationHost.config files could trigger.Let’s fix your IIS restore process step-by-step while investigating why W3SVC is being terminated.
Steps to Resolve IIS Restoration Killing W3SVC
Step 1: Verify the Backup Configuration
There could be corruption or unsupported configuration elements in the backup files you're attempting to restore.- Inspect the Backup Files:
- Navigate to your backup folder:
Code:C:\Windows\System32\inetsrv\backup\<backupname> - Open
applicationHost.configin a text editor (like Notepad or Notepad++). - Look for:
- Invalid XML structure (e.g., unclosed tags).
- Unrecognized or custom modules (particularly under
<system.webServer>or<modules>). - Bad site or application references (e.g.,
<site>pointing to non-existent directories).
- Navigate to your backup folder:
- Repair or Simplify Config (If Necessary):
- Temporarily simplify the configuration to contain only basic/default settings:
- Keep
<sites>defined for core IIS sites (if critical to restore). - Remove custom
<modules>or<isapiFilters>entries that might trigger crashes.
- Keep
applicationHost.configbackup might look like:
Code:xml <configuration> <system.applicationHost> <sites> <site name="Default Web Site" id="1"> <application path="/" applicationPool="DefaultAppPool"> <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" /> </application> </site> </sites> <applicationPools> <add name="DefaultAppPool" /> </applicationPools> </system.applicationHost> </configuration> - Temporarily simplify the configuration to contain only basic/default settings:
- Retry the Restore Command After Reviewing:
Code:bash appcmd restore backup "backupname"
Step 2: Test and Start the IIS Services Directly
After restoring the configuration, test if services can restart manually to debug errors.- Attempt to Start W3SVC:
Code:bash net start W3SVC - If W3SVC Fails to Start:
- Check the following logs for error details:
- Event Viewer > Windows Logs > System or Application.
- Review failures related to
W3SVC,IIS, orWAS(Windows Activation Service).
- Check the following logs for error details:
Step 3: Clear Corrupted App Pools and Sites
Custom sites or application pools can also cause instability during restoration.- List Application Pools:
Code:bash appcmd list apppool - Default Application Pools to Test:
- Ensure
DefaultAppPoolexists and is functional (repair if necessary):
Code:bash appcmd add apppool /name:"DefaultAppPool"
- Ensure
- Remove Corrupted Sites or Apps (Manually Identify Issues):
Code:bash appcmd list site - Restart IIS Services:
Code:bash iisreset
Step 4: Temporarily Disable Problematic Modules
Custom IIS modules or ISAPI filters can crashW3SVC when included in a restored configuration.- Open your backup
applicationHost.configfile. - Look for
<modules>:- Temporarily comment or remove any non-standard or custom modules (especially 3rd-party ones).
Example:
Code:xml <modules> <!-- Temporarily remove problematic modules --> <add name="CustomModule" /> </modules>
- Temporarily comment or remove any non-standard or custom modules (especially 3rd-party ones).
- Retry Restore and Restart:
Code:bash appcmd restore backup "backupname" iisreset
Step 5: Validate Permissions for IIS Files
The "Access Denied" errors during previous attempts and stopping of W3SVC may be connected to permissions issues.- Check Config Folder Permissions:
- Navigate to:
0Code:xml <configuration> <system.applicationHost> <sites> <site name="Default Web Site" id="1"> <application path="/" applicationPool="DefaultAppPool"> <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" /> </application> </site> </sites> <applicationPools> <add name="DefaultAppPool" /> </applicationPools> </system.applicationHost> </configuration> - Ensure the following accounts have Full Control:
SYSTEMAdministrators
- Navigate to:
- Apply Permissions Recursively:
- Right-click the folder > Properties > Security > Advanced.
- Check the box "Replace all child object permissions with inheritable permissions from this object."
- Restart IIS Services:
- If restoring succeeds, attempt to restart W3SVC again:
1Code:xml <configuration> <system.applicationHost> <sites> <site name="Default Web Site" id="1"> <application path="/" applicationPool="DefaultAppPool"> <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" /> </application> </site> </sites> <applicationPools> <add name="DefaultAppPool" /> </applicationPools> </system.applicationHost> </configuration>
- If restoring succeeds, attempt to restart W3SVC again:
Step 6: Rebuild Configuration if Restoration Fails
If all else fails, manually reconstruct IIS instead of restoring the full backup.- Create a New IIS Baseline:
- Rebuild IIS with default settings:
2Code:xml <configuration> <system.applicationHost> <sites> <site name="Default Web Site" id="1"> <application path="/" applicationPool="DefaultAppPool"> <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" /> </application> </site> </sites> <applicationPools> <add name="DefaultAppPool" /> </applicationPools> </system.applicationHost> </configuration>
- Rebuild IIS with default settings:
- Restore Manual Configurations:
- Manually migrate the backup file settings (e.g.,
<sites>,<appPools>) into the newapplicationHost.config.
- Manually migrate the backup file settings (e.g.,
Logs for Debugging
If services (like W3SVC) still won't start, check the following logs for granular errors:- Event Viewer:
- Review System Logs for
W3SVCerrors. - Look for terms like:
- "Invalid configuration."
- "File not found."
- Review System Logs for
- HTTP Error Logs:
- Found at:
3Code:xml <configuration> <system.applicationHost> <sites> <site name="Default Web Site" id="1"> <application path="/" applicationPool="DefaultAppPool"> <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" /> </application> </site> </sites> <applicationPools> <add name="DefaultAppPool" /> </applicationPools> </system.applicationHost> </configuration>
- Found at:
- Application Errors:
- Review logs for
.NET Framework, IIS extensions, or app pools.
- Review logs for
Summary of Steps
- First, simplify and verify the backup's configuration (
applicationHost.config) to ensure it is clean and valid. - Stop IIS services before restoring and validate whether W3SVC can restart after applying the backup.
- If restoration continuously fails due to config issues or W3SVC crashes, rebuild the server’s IIS configuration manually.
- Joined
- Mar 14, 2023
- Messages
- 100,424
Thanks for clarifying! If you’re able to create a backup of the Default Website successfully but cannot restore it, this strongly suggests there’s an underlying permission issue somewhere in the restore process, specifically when
Let’s dig deeper and get this restore working.
appcmd attempts to overwrite files in IIS directories. Since the issue persists even with a new, valid backup of the Default Website, we can eliminate corruption in the backup file itself and focus on permissions, locks, or restrictive policies.Let’s dig deeper and get this restore working.
Updated Steps to Address Failed Restore
Step 1: Test by Restoring While IIS Services Are Stopped
The Access Denied issue might occur because the restore process tries to overwrite IIS configuration files while services likeW3SVC or WAS are actively running, locking key files like applicationHost.config.- Stop IIS Services Properly:
- Run:
Code:bash net stop W3SVC net stop IISADMIN net stop WAS
- Run:
- Cleanly Retry the Restore Command:
Code:bash appcmd restore backup "backupname" - If Successful:
- Restart the IIS services:
Code:bash net start WAS net start W3SVC
- Restart the IIS services:
- If the Same Error Occurs:
Proceed to adjust permissions and identify the locking process in Step 2.
Step 2: Verify and Fix Permissions on IIS Config Files
The "Access Denied" error strongly suggests a permission issue preventingappcmd from writing updated configuration files. You may be missing write access to key files/folders like applicationHost.config during the restore.- Go to the IIS Configuration Folder:
Code:C:\Windows\System32\inetsrv\config - Check File Permissions:
- Right-click the
applicationHost.configfile > Properties > Security tab. - Verify the following accounts have Full Control:
- Administrators
- SYSTEM
- If any accounts are missing or lack Full Control, add them:
- Click Edit > Add > Enter the account name and grant permissions.
- Right-click the
- Apply Permissions Recursively:
- Ensure the same permissions are applied to:
- The folder containing the config (
C:\Windows\System32\inetsrv\config). - All child objects/files.
- The folder containing the config (
- To propagate permissions:
- Open Advanced Security Settings > Enable Replace all child object permissions.
- Ensure the same permissions are applied to:
- Retry the Restore Command:
Code:bash appcmd restore backup "backupname"
Step 3: Temporarily Disable UAC
Even as an Administrator, User Account Control (UAC) can impose restrictions on elevated actions, including overwriting system files.- Disable UAC Temporarily:
- Open Control Panel > User Accounts > Change User Account Control Settings.
- Move the slider to Never Notify.
- Reboot the server if prompted.
- Run the Restore Command:
Code:bash appcmd restore backup "backupname" - Re-enable UAC afterward (set slider back to original level).
Step 4: Verify Windows Process Locks
A background process or open file handle may be preventing successful restoration.- Check for Locked Files:
- Use Process Explorer (Sysinternals) to locate locks:
- Launch Process Explorer (Admin Mode).
- Go to Find > Find Handle or DLL.
- Search for:
Code:applicationHost.config
- Identify the process holding the file handle (common examples:
w3wp.exeorinetinfo.exe).
- Use Process Explorer (Sysinternals) to locate locks:
- Kill Locking Process:
- Manually terminate the locking process if identified.
Step 5: Use Safe Mode to Bypass Service Interference
If previous steps fail, rely on Safe Mode to bypass running services that might interfere with the restore process.- Start the System in Safe Mode:
- Reboot and press F8 (or Shift + F8) to access Advanced Boot Options.
- Select Safe Mode with Networking.
- Retry the Restore Command:
Code:bash appcmd restore backup "backupname" - Reboot Into Normal Mode:
- After restoring, restart the server and verify if the restoration resolves the issue.
Step 6: Test Manual File Copy (If Restore Still Fails)
Ifappcmd restore backup consistently fails despite correct permissions, manually apply the backup configuration.- Go to the Backup Location:
- Open:
Code:C:\Windows\System32\inetsrv\backup\<backupname>
- Open:
- Manually Replace Configuration File:
- Backup the current config files in
C:\Windows\System32\inetsrv\config:- Copy the
applicationHost.configfile to a backup directory.
- Copy the
- Replace it with the
applicationHost.configfrom<backupname>.
- Backup the current config files in
- Restart IIS Services:
Code:bash net start WAS net start W3SVC
Step 7: Review Relevant Logs
- Open Event Viewer:
- Look for errors in:
0Code:bash appcmd restore backup "backupname"
- Look for errors in:
- Check Log Entries:
- Look for entries associated with
IISADMIN,W3SVC, orapplicationHost.config.
- Look for entries associated with
- Let me know if specific error codes or new patterns emerge from the logs.
Next Steps if Issues Persist
If none of the above steps resolve the issue:- Share details about additional error messages or access patterns.
- Let me know if you’ve worked with custom configuration elements or modules that might affect IIS behavior.
- Joined
- Mar 14, 2023
- Messages
- 100,424
If
Let’s resolve these stuck services and regain control of IIS and its dependent components:
WAS (Windows Process Activation Service) is stuck because dependent services like Net.Pipe Listener Adapter, Net.TCP Listener Adapter, or Net.Tcp Port Sharing Service are in a "stuck starting" state, this is preventing WAS (and likely W3SVC) from stopping cleanly. These services are interdependent, and a failure in one can cascade to the others.Let’s resolve these stuck services and regain control of IIS and its dependent components:
Steps to Fix Stuck Services and Restore IIS Functionality
Step 1: Forcefully Kill Stuck Services
If stopping the dependent services withnet stop isn’t working, forcefully terminate them.- Identify PIDs for Stuck Services:
- Run the following command to list the status of all services:
Code:bash sc queryex type= service state= all - Find the following services and note their PID:
- Net.Pipe Listener Adapter: Service name is
NetPipeActivator - Net.TCP Listener Adapter: Service name is
NetTcpActivator - Net.Tcp Port Sharing Service: Service name is
NetTcpPortSharing
- Net.Pipe Listener Adapter: Service name is
- Run the following command to list the status of all services:
- Kill the Processes:
- Forcefully terminate the services using their PID:
Code:bash taskkill /pid <PID> /f - Example:
Code:bash taskkill /pid 12345 /f
- Forcefully terminate the services using their PID:
- Once the dependent services are stopped, stop WAS:
Code:bash net stop WAS
Step 2: Validate Services and Clear Corruption
If the services remain stuck, their configurations may be corrupted or improperly registered.- Re-Register the Services:
- Open Command Prompt (Admin) and run:
Code:bash sc config NetPipeActivator start= demand sc config NetTcpActivator start= demand sc config NetTcpPortSharing start= demand sc config WAS start= demand
- Open Command Prompt (Admin) and run:
- Check Service Dependencies:
- Confirm required dependencies for these services:
Code:bash sc qc NetPipeActivator sc qc NetTcpActivator sc qc NetTcpPortSharing
- Confirm required dependencies for these services:
- Restart the Services:
- Start each service sequentially to test dependencies:
Code:bash net start NetPipeActivator net start NetTcpActivator net start NetTcpPortSharing net start WAS
- Start each service sequentially to test dependencies:
Step 3: Repair WCF and Net.TCP Features
These services are tied to Windows Communication Foundation (WCF) and .NET Framework features. If dependencies are missing or damaged, the services won’t behave correctly.- Repair .NET Framework Core Features:
- Fix related features using DISM:
Code:bash dism /online /enable-feature /featurename:NetFx4 /all dism /online /enable-feature /featurename:NET-WCF-Services45 /all
- Fix related features using DISM:
- Repair or Reinstall Net.TCP Support:
- Add missing Net.TCP features using DISM:
Code:bash dism /online /enable-feature /featurename:NET-WCF-TCP-Activation45
- Add missing Net.TCP features using DISM:
Step 4: Temporarily Disable Services to Restore WAS
If the above steps don’t resolve the stuck state, disable the related services and start WAS first.- Disable Net.TCP and Pipe Services:
- Temporarily disable the stuck services:
Code:bash sc config NetPipeActivator start= disabled sc config NetTcpActivator start= disabled sc config NetTcpPortSharing start= disabled
- Temporarily disable the stuck services:
- Stop and Restart WAS:
- Now stop and restart the Windows Process Activation Service (WAS):
0Code:bash taskkill /pid <PID> /f
- Now stop and restart the Windows Process Activation Service (WAS):
- Re-enable the Dependent Services:
- Set the dependent services back to their defaults:
1Code:bash taskkill /pid <PID> /f
- Set the dependent services back to their defaults:
Step 5: Check for Locked Files
Locked resources can cause services to get stuck. Use Process Explorer or Resource Monitor to identify problematic locks.- Open Resource Monitor:
- Open Task Manager > Performance tab > Open Resource Monitor.
- Check the CPU or Disk tabs.
- Look for high activity tied to services like:
NetPipeActivatorNetTcpActivator
- Kill locking processes manually after identifying them.
Step 6: Investigate Logs
If services still won’t stop or start properly, logs might indicate the reason.- Review Windows Logs:
- Open Event Viewer > Windows Logs > System.
- Look for errors tied to:
NetPipeActivatorNetTcpActivatorWASW3SVC
- Key Errors to Investigate:
- Errors related to missing dependencies or file paths.
- Configuration corruption that references files or features no longer present.
Step 7: Repair Component Store
If the services won't stop because of corrupted components, repair the underlying component store.- Run DISM to Repair the Component Store:
2Code:bash taskkill /pid <PID> /f - Run System File Checker:
3Code:bash taskkill /pid <PID> /f - Reattempt the service operations after this.
Step 8: Manual File Restore
If locking or corruption persists:- Navigate to WAS and dependent service configuration files:
4Code:bash taskkill /pid <PID> /f - Backup both files, then restore from clean defaults or backups.
If Services Are Now Stopped
Once services are stopped:- Retry the IIS restore:
5Code:bash taskkill /pid <PID> /f - Start the services after the restore completes:
6Code:bash taskkill /pid <PID> /f
Let Me Know
Let me know if services remain stuck or if new error messages/log entries appear. Together, we’ll dig deeper into fixing this issue!- Joined
- Mar 14, 2023
- Messages
- 100,424
Thanks for clarifying—the Net.Msmq Listener Adapter is another dependent service tied to Windows Process Activation Service (WAS), often used for MSMQ (Microsoft Message Queuing) in WCF (Windows Communication Foundation). If this service is stuck in the "starting" state and preventing WAS from stopping, we need to address it specifically.
The stuck "starting" state usually results from:
6
The stuck "starting" state usually results from:
- Corrupted service configuration or bad dependencies.
- MSMQ components not being properly registered.
- Permission issues or resource locks.
Steps to Fix Stuck Net.Msmq Listener Adapter
Step 1: Forcefully Stop the Stuck Services
To regain control over Net.Msmq Listener Adapter and WAS, forcefully terminate the stuck service.- Find the PID of the Stuck Service:
Run:
Code:bash sc queryex NetMsmqActivator- Look for PID in the output (e.g., PID=XXXX).
- Kill the Process:
- Forcefully terminate the service process using its PID:
Example:Code:bash taskkill /pid <PID> /f
Code:bash taskkill /pid 12345 /f
- Forcefully terminate the service process using its PID:
- Retry Stopping WAS:
Code:bash net stop WAS
Step 2: Restart MSMQ Components
Net.Msmq Listener Adapter depends on MSMQ features. Restarting these services often clears the stuck state.- Stop the MSMQ Service (if running):
Code:bash net stop MSMQ - Restart the MSMQ Service:
Code:bash net start MSMQ - Try Starting the Listener Adapter:
Code:bash net start NetMsmqActivator
Step 3: Repair MSMQ and .NET WCF Services
If there's a deeper issue with MSMQ or its dependent components (e.g., WCF features), repairing these can resolve the listener adapter's stuck state.- Re-enable MSMQ Services:
- Use the DISM command to ensure that MSMQ components are reinstalled:
Code:bash dism /online /enable-feature /featurename:MSMQ-Server /all
- Use the DISM command to ensure that MSMQ components are reinstalled:
- Repair WCF Services:
- Run:
Code:bash dism /online /enable-feature /featurename:NET-WCF-MSMQ-Activation45 /all
- Run:
- Test the Listener Adapter:
Code:bash net start NetMsmqActivator - Restart WAS:
0Code:bash taskkill /pid <PID> /f
Step 4: Temporarily Disable Listener Adapter
If the listener adapter remains stuck or isn’t critical to current operations, you can disable it temporarily to focus on WAS/IIS.- Disable the Listener Adapter:
1Code:bash taskkill /pid <PID> /f - Stop WAS Again:
2Code:bash taskkill /pid <PID> /f - Retry the IIS Restore:
3Code:bash taskkill /pid <PID> /f - Re-enable the Listener Adapter After the Restore:
4Code:bash taskkill /pid <PID> /f
Step 5: Rebuild Listener Adapter Registration
If the Net.Msmq Listener Adapter service is corrupted, rebuilding or re-registering it will resolve the issue.- Re-register the Service:
Run:
5Code:bash taskkill /pid <PID> /f - Manually Fix Registrations (As Needed):
- View or repair configuration files such as
machine.configorapplicationHost.config.
- View or repair configuration files such as
Code:
bash taskkill /pid <PID> /f
- Restart and Test:
7Code:bash taskkill /pid <PID> /f
Step 6: Investigate Logs
Check logs for specific errors if the service remains stuck.- Event Viewer:
- Open
eventvwr.msc. - Look at:
- Windows Logs > System (search for
NetMsmqActivator). - Applications and Services Logs > Microsoft-Windows-WAS > Operational.
- Windows Logs > System (search for
- Open
- Common Errors to Investigate:
- Dependencies failing, like MSMQ or .NET WCF.
- Access or policy issues blocking service startup.
Step 7: Reset Component State
If none of the above resolve the issue, the system configuration for MSMQ or WCF features may require a full reset.- Revert Pending Actions:
- Clean pending system changes:
8Code:bash taskkill /pid <PID> /f
- Clean pending system changes:
- Repair Component Store:
- Run:
9Code:bash taskkill /pid <PID> /f
- Run:
- Restart and Re-test Services:
Retry stopping WAS and running the restore command.
Summary
To resolve the stuck Net.Msmq Listener Adapter state:- Force stop the process using
taskkill. - Repair or reinstall MSMQ services (
dism /enable-feature). - Rebuild or re-register the
NetMsmqActivatorservice if corruption is causing the issue.
appcmd restore backup). Let me know the outcome or if other new errors appear—we’ll refine from there!