Skip to content

Instantly share code, notes, and snippets.

@mercdev
Created September 11, 2015 20:48
Show Gist options
  • Save mercdev/c898b7973df68fe3ea32 to your computer and use it in GitHub Desktop.
Save mercdev/c898b7973df68fe3ea32 to your computer and use it in GitHub Desktop.
Remote IIS info via PowerShell
$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