How would I call on the Physical Path credentials property for web applications in IIS using PowerShell? I can't print out the username or password, but I can print the logonMethod
which uses the same property? Below is my code for web applications. I have tried using $webapp.virtualDirectoryDefaults
and using $webapp.userName
but neither works for web applications.
$webapps = Get-WebApplication -Site $Site.name
foreach($webapp in $webAPPS)
{
Write-Host $webapp.applicationPool
Write-Host $WebApp.virtualDirectoryDefaults.userName
Write-Host $webapp.virtualDirectoryDefaults.password
Write-Host $webapp.virtualDirectoryDefaults.logonMethod
$webapp2 = $webapp.path
Write-Host $WebApp2.split("/")[-1] "::: is the Web Application" -ForegroundColor Green
}