From 38a82b6ce80b27049684a9e7ca5316e24b540340 Mon Sep 17 00:00:00 2001 From: Danny de Kooker Date: Wed, 5 Mar 2025 21:59:58 +0100 Subject: [PATCH] Added a check to create the export folder if not exists --- Exchange/Export-all-mailboxes.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Exchange/Export-all-mailboxes.ps1 b/Exchange/Export-all-mailboxes.ps1 index bd8c464..cec9a2a 100644 --- a/Exchange/Export-all-mailboxes.ps1 +++ b/Exchange/Export-all-mailboxes.ps1 @@ -3,6 +3,8 @@ $Mailboxes = Get-Mailbox -ResultSize Unlimited $TotalMailboxes = $Mailboxes.Count $CurrentMailbox = 0 +if (!(test-path $ExportPath)) {mkdir $ExportPath} + foreach ($Mailbox in $Mailboxes) { $CurrentMailbox++