This file contains 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
# I don't like passing a clear text password and it sounds like this will not be fixed anytime soon | |
# only an admin can run the WebAdministration module, but this could cause issues in some instances. | |
$IISSite = "mycoolsite" | |
Import-Module -Name WebAdministration | |
$SiteProperties = (Get-Website -Name $IISSite | Select-Object -Property *) | |
$SecurePassword = ConvertTo-SecureString -String $SiteProperties.password -AsPlainText -Force | |
$SiteProperties.password = $null | |
$SiteProperties | Add-Member -MemberType NoteProperty -Name "SecurePassword" -Value $SecurePassword | |
$SiteProperties | Format-List |