5

I am a member of the local administrator's group on a Windows Server 2012 machine, but when I try to run IISReset from the command prompt I get:

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.

I've disabled UAC on this machine, and I'm RDP'd in via remote Desktop Connection Manager, so I'm not sure why the machine thinks I'm not a local administrator.

3
  • 1
    Even with UAC disabled, are you using an administrative command prompt?
    – TheCleaner
    Aug 18, 2014 at 14:12
  • No, and when I do IISReset works. Would you mind pointing me to any document that would explain what the difference is between logging in as an administrator and using the administrator command prompt? I'm unsure why this is working.
    – Sean Long
    Aug 18, 2014 at 14:14
  • Sean, I posted it as an answer.
    – TheCleaner
    Aug 18, 2014 at 14:21

3 Answers 3

4

Even with UAC disabled, are you using an administrative command prompt?

The security token for administratively running IISRESET isn't there under a normal command prompt even if you've moved the UAC slider to "Never Notify".

You can follow these steps:

  1. Open PowerShell
  2. Type Regedit then hit enter
  3. Browse to HKEY_LOCAL_MACHINE\SOFTWARE\MicrosoftWindows\CurrentVersion\policies\system
  4. Double click on EnableLUA
  5. Change the Value data to a 0
  6. Click OK, then reboot the server

to completely disable UAC, and then try running IISRESET from a normal cmd prompt, but it isn't good practice to completely disable UAC on any server.

CREDIT: http://www.nimbo.com/blog/how-to-disable-user-account-control-in-windows-server-2012/

2
  • 1
    That should read: Browse to HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/policies/system
    – GlennG
    Jan 26, 2015 at 16:52
  • @GlennG thank you for noticing...I'll edit it now.
    – TheCleaner
    Jan 26, 2015 at 18:47
4

If you always get this error, then see other answers, however if you sometimes get this error, and then re-running the command fixes it then the problem you're actually seeing is the issue documented over here:

https://www.leansentry.com/guide/reset-restart-recycle-iis/dangers-of-iisreset#it-can-leave-your-server-in-a-stopped-state

And the fix (on IIS 7.0+) is to use a slightly longer set of commands, that runs IISReset "properly":

iisreset /stop /timeout:60
taskkill /F /FI "SERVICES eq was"
iisreset /start

(Specifically here in that article)

Roughly speaking, the default iisreset has a timeout for IIS to respond gracefully, and gives this (very misleading) error message if the timeout is missed ... which in certain cases it will do by default.


Note that the overall opinion of the article is the iisreset is the wrong command to be using in the first place, and that other tools are better.

I make no comment on this opinion ;)

0

I recently ran into the same issue. As it turns out, iisreset will fail to execute (with this misleading error) if the IISADMIN service is deactivated. In my case, this occured because of a failed Exchange patch installation (namely KB5007409 for Exchange 2019 CU11), which had left all Exchange-related services as well as all IIS services in a disabled state. To fix it, run from an elevated powershell prompt:

set-service iisadmin -startuptype automatic
start-service iisadmin

You might have to repeat the same for w3svc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .