-
Notifications
You must be signed in to change notification settings - Fork 367
Update FreeBusyChecker.ps1 #2430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a dependency issue where the FreeBusyChecker script required the ExchangeOnlineManagement module even when checking only on-premises Exchange configurations. The fix allows the script to run on Exchange servers without the EXO module when using the -Org ExOnPremise parameter.
- Removed the static
#Requires -Module ExchangeOnlineManagementdirective - Added conditional checking and importing of the ExchangeOnlineManagement module only when needed
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@MarcoLFrancisco to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not allowed to import modules in script execution. Therefore "Import-Module ExchangeOnlineManagement -ErrorAction Stop" cant be used
In Exchange Online part we check if it is connected to Exchange online. A previous check can be done for Exchange Online Module and exit with write-host "Exchange Online Module not installed"
@MarcoLFrancisco You can actually use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, thank you!
Understood. Thank you for the clarification. Approved. |
The script should still run if the -Org parameter is set to check ExOnPremise Only, e.g: Running on an exchange server with no direct outbound connection to Entra/EXO.. or modules cannot be installed.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@Ghost0s please address the code formatting for the pipeline to complete. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@Ghost0s please follow our contributing guides to get your PR to properly work and pass the build pipeline process: https://github.com/microsoft/CSS-Exchange/blob/main/CONTRIBUTING.md Then if you know how, please rebase your branch so there is only 1 commit on the branch you are trying to merge into ours. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@MedElhamm0uti as I provided before, you need to follow the contributing guide to get past the build pipeline. Otherwise, this PR will not merge. https://github.com/microsoft/CSS-Exchange/blob/main/CONTRIBUTING.md |

Issue:
The script cannot run on Exchange servers without the EXO module being installed even when checking only On-prem conf
Reason:
The script should still run if the -Org parameter is set to check ExOnPremise Only, e.g: Running on an exchange server with no direct outbound connection to Entra/EXO.. or where EXO module cannot be installed.
Fix:
Removed the static requirement for EXO module and replaced it with a conditional check.
Validation:
Provide if applicable