0

When trying to stop/start IIS application pool on a remote server using

Invoke-Command -ComputerName $HostName -ScriptBlock { 
            param($ServiceName) 
            Start-WebAppPool -Name $ServiceName 
        } -ArgumentList ($ServiceName)

I receive an error

Process should have elevated status to access IIS configuration data.
Cannot find drive. A drive with the name 'IIS' does not exist.
    + CategoryInfo          : ObjectNotFound: (IIS:String) [Start-WebItem], DriveNotFoundExceptio 
   n
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.IIs.PowerShell.Provider.StartItemCommand
    + PSComputerName        : server123

I've discovered some answers here concerning this error. So, the question - is having admin rights (= including my user into Administrators group) on target machine obligatory to have an ability just to start/stop application pools?

Laser42
  • 646
  • 2
  • 7
  • 24
  • One assumption you should make is that all IIS operations require administrator permissions. Rarely you hit an exception of that, because its original design was in that way, https://halfblood.pro/whats-microsoft-web-administration-and-the-horrible-facts-you-should-know-b82f2c974da6 ('Microsoft.Web.Administration` is the API behind IIS Manager). – Lex Li Jul 28 '22 at 18:20
  • This link may help you: [https://blogs.iis.net/ma_khan/troubleshooting-iis-powershell-module-on-windows-7-rc](https://blogs.iis.net/ma_khan/troubleshooting-iis-powershell-module-on-windows-7-rc). – samwu Jul 29 '22 at 09:58

0 Answers0