Skip to content

Instantly share code, notes, and snippets.

@keithbloom
Created October 28, 2011 21:11
Show Gist options
  • Save keithbloom/1323578 to your computer and use it in GitHub Desktop.
Save keithbloom/1323578 to your computer and use it in GitHub Desktop.
3ReasonsForUsingPowershell
set-location \\\\servername\sharename
remove-item c:\temp\**\*.bak
(Get-WmiObject -computer servername Win32_service -Filter "Name='W3SVC'").StartService()
Get-WmiObject -namespace "root/MicrosoftIISV2" -ComputerName "Server" -Credential "yourname" -Authentication PacketPrivacy -Query "SELECT * FROM IIsWebServerSetting" | select { $_.ServerComment, $_.LogFileDirectory }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment