1 | 1 | | $target = "mail.local" |
2 | 2 | | $checkdns = Resolve-DnsName $target -ErrorAction SilentlyContinue |
| 3 | + | $webtest1 = "0" |
| 4 | + | $webtest2 = "0" |
3 | 5 | | |
4 | 6 | | if($checkdns){ |
5 | 7 | | Write-host "Running autodiscover test..." -ForegroundColor Cyan |
6 | 8 | | try |
7 | 9 | | { |
8 | | - | $webtest1 = Invoke-WebRequest -uri "https://$target/autodiscover" |
| 10 | + | $webtest1 = Invoke-WebRequest -uri "https://$target/autodiscover" -Verbose |
9 | 11 | | } |
10 | 12 | | catch |
11 | 13 | | { |
| skipped 8 lines |
20 | 22 | | try |
21 | 23 | | { |
22 | 24 | | write-host "testing site..." -ForegroundColor Gray |
23 | | - | $webtest2 = invoke-webrequest -uri "https://$target/autodiscover/[email protected]/owa/&Email=autodiscover/[email protected]&Protocol=HACKER&Protocol=Powershell" |
| 25 | + | $webtest3 = invoke-webrequest -uri "https://$target/autodiscover/[email protected]/owa/&Email=autodiscover/[email protected]&Protocol=HACKER&Protocol=PowerShell" -Verbose |
24 | 26 | | } |
25 | 27 | | catch |
26 | 28 | | { |
| skipped 24 lines |
51 | 53 | | write-host "DNS does not resolve" -ForegroundColor Red |
52 | 54 | | } |
53 | 55 | | |
| 56 | + | if(Get-Variable webtest1){Clear-Variable webtest1} |
| 57 | + | if(Get-Variable webtest2){Clear-Variable webtest2} |
| 58 | + | |