Exchange Virtual Directory Reporting Script

This script is built to create an HTML report of the different Virtual Directories in your environment. For now, it supports Exchange 2010/2013/2O16. The script searches for CAS servers and queries the common virtual directories like: AutoDiscover, OWA, ECP, OAB, EWS, EAS & OA.

 
 
 
 
 
5 Star
(3)
5,037 times
Add to favorites
Exchange
9/12/2016
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • PowerShell Virtual Directories
    3 Posts | Last post December 01, 2017
    • We are nearing the end of our Exchange 2010 to Exchange 2013 upgrade/migration and your script does a wonderful job of grabbing the important virtual directory information. It will come in handy when we switch our namespace over to Exchange 2013 this weekend.
      One thing though.
      Looking at the Exchange 2013 EAC/Servers/Virtual Directories, I see that there is listed PowerShell virtual directories and PowerShell-Proxy virtual directories.
      Would it be possible to request that these virtual directories be included in this script?
      Thanks
      Ed Kummel
    • Hi Ed,
      
      sorry for the (very) belated reply. The PowerShell virtual directories are usually not modified (or very seldom); is there any specific information you wanted to get from them?
      
      -Michael
    • Hi Ed,
      
      Just came by this post and saw your request was not addressed. So the PowerShell Virtual directory request formatted in Michael's exact manner as is found in this script.
      
      #Exchange PowerShell 
      
               $html += "<br/><br/>"
      		$html += "<h1>Exchange PowerShell:</h1>"
      		$html += "<table border='1'>"
      		$html += "<tr class='color'>"
      		$html += "<td>Server</td><td>Internal URL</td><td>External Url</td><td>Auth. (Int.)</td><td>Auth. (Ext.)</td><td>Last modified on:</td>"
      		$html += "</tr>"
      		$i = 0
      		foreach ($server in $servers)
      		{
      			$i++
      			Write-Progress -Activity "Getting PowerShell Information" -Status "Progress:" -PercentComplete (($i / $servers.count) * 100)
      			if ($ADProperties)
      			{
      				$epresult = Get-PowerShellVirtualDirectory -server $server.name -ADPropertiesOnly | Select Server, InternalUrl, ExternalUrl, ExternalAuthenticationMethods, InternalAuthenticationMethods, WhenChanged
      			}
      			else
      			{
      				$epresult = Get-PowerShellVirtualDirectory -server $server.name | Select Server, InternalUrl, ExternalUrl, ExternalAuthenticationMethods, InternalAuthenticationMethods,WhenChanged
      			}
      			
      			
      			$ephtml += "<tr.color>"
      			$ephtml += "<td>" + $epresult.Server + "</td>"
      			$ephtml += "<td>" + $epresult.InternalURL.absoluteUri + "</td>"
      			$ephtml += "<td>" + $epresult.ExternalURL.absoluteUri + "</td>"
      			$ephtml += "<td>" + $epresult.InternalAuthenticationMethods + "</td>"
      			$ephtml += "<td>" + $epresult.ExternalAuthenticationMethods + "</td>"
      			$ephtml += "<td>" + $epresult.WhenChanged + "</td>"
      			$ephtml += "</tr>"
      			
      			Clear-Variable easresult
      		}
      		$html += $ephtml
      		$html += "</table>" 
  • runs and quits, does not build report
    1 Posts | Last post October 25, 2016
    • On Exchange Management Shell on an Exchange 2013 server, running it with the correct dot-sourcing, ex: .\script.ps1   (it just runs and immediately quits, does not generate anything in c:\reports, even though I verified that directory exists).
      This is the second environment where I tried and failed to use this script. Would really like to see it work!
  • Unable to run this sript on 2010
    4 Posts | Last post September 15, 2016
    • tried running on Multiple exchange 2010 servers.  Runs really fast and then comes back with nothing. Does not generate a file. No errors reported at all. 
    • I had the same issue, tried on 2016 CU2 and 2013 servers, the script gives no message and generates no files.
    • Hi both,
      
      are you sure that you are dot-sourcing the script correctly. I realize that it might be a little odd having to run the script as such --but that was a deliberate choice.
      
      So, before you can run the command, you must dot source it as follows:
      . .\Getvirdirinfo.ps1
      
      Once you've done that, the Get-VirDirInfo cmdlet becomes available to you which will kick off the actually script.
      
      -Michael
    • Ah my bad! :) I didn't noticed the extra dot, everything works as expected. Just one more question: when I run it on a Exchange machine, it works, if I try to run this from a machine connected to the Exchange server with Remote PowerShell, it gives some errors and won't generate the file. Any clues? Thanks!