Created
September 11, 2015 20:48
-
-
Save mercdev/c898b7973df68fe3ea32 to your computer and use it in GitHub Desktop.
Remote IIS info via PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$website = 'Default' | |
$server = 'SOME_SERVER_01' | |
$session = New-PSSession -ComputerName $server -Name "My_Session_Name" | |
$remoteOriginalFolder = Invoke-Command -Session $session -ScriptBlock { param($website) | |
Import-Module WebAdministration | |
$originalFolder = Get-WebFilePath IIS:\Sites\$website | |
return $originalFolder.FullName | |
} -ArgumentList $website | |
$remoteOriginalFolder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment