Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Diagnostics/FreeBusyChecker/FreeBusyChecker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ This cmdlet will run the Free Busy Checker Script for Exchange On-Premises Avail
#>
#region Properties and Parameters

#Requires -Module ExchangeOnlineManagement
#Requires -Module ActiveDirectory

[CmdletBinding(DefaultParameterSetName = "FreeBusyInfo_OP", SupportsShouldProcess)]
Expand Down Expand Up @@ -119,6 +118,15 @@ begin {
$Script:Server = hostname
$Script:startingDate = (Get-Date -Format yyyyMMdd_HHmmss)
$Script:htmlFile = "$PSScriptRoot\FBCheckerOutput_$($Script:startingDate).html"

#Check if EXO module is required and available, if so, import it.
if (-not $Org -or ($Org -eq 'ExchangeOnline')) {
if (-not (Get-Module -ListAvailable -Name ExchangeOnlineManagement)) {
Write-Error "The ExchangeOnlineManagement module is required but not installed.
Install it with: Install-Module ExchangeOnlineManagement"
return
}
Import-Module ExchangeOnlineManagement -ErrorAction Stop}

loadingParameters
#Parameter input
Expand Down
Loading