1
PS C:\WINDOWS\system32> Invoke-Command -ComputerName "UABEP1" -ScriptBlock { Get-ChildItem -Path IIS:\AppPools }

Cannot find drive. A drive with the name 'IIS' does not exist.
    + CategoryInfo          : ObjectNotFound: (IIS:String) [Get-ChildItem], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
    + PSComputerName        : UABEP1

Running the command locally on the remote machine returns the list of app pools. Is there a security setting that must be changed?

1 Answer 1

3

You're forgetting to load the WebAdministration module:

{ Import-Module WebAdministration; Get-ChildItem -Path IIS:\AppPools }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.