getting users, gettings mailbox, dialog functions, error trycatch

This commit is contained in:
2022-08-25 17:27:45 +02:00
parent 6401784fbd
commit 9e41fe51ca
8 changed files with 147 additions and 40 deletions

20
utils/dev-note.txt Normal file
View File

@@ -0,0 +1,20 @@
Get-ExecutionPolicy
Set-ExecutionPolicy Unrestricted
Set-ExecutionPolicy Restricted
Install powershell 7 from powershell 5 :
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
foreach ($u in $users)
{
Write-Host $u.Name -ForegroundColor Green
$cal = Get-MailboxFolderStatistics $u.Identity -FolderScope Calendar | Where-Object {$_.Name -in @("Agenda", "Calendar", "Calendrier", "Kalender")}
foreach ($c in $cal)
{
Write-Output $c.Name
}
}

30
utils/functions.ps1 Normal file
View File

@@ -0,0 +1,30 @@
<##
# EXCAL-ARIGHTS - utilities function
#
# @version 1.0.0
# @since 08-25-2022
#
# @author Jérémi Nihart <contact@endmove.eu>
# @copyright © 2022 EndMove, All rights reserved.
#
# @link https://git.endmove.eu/EndMove/excal-arights
#>
# Show a question dialog (yes/no)
Function DialogAsk {
param (
[string]$Title,
[string]$Message
)
$MsgBoxInput = [System.Windows.MessageBox]::Show($Message, $Title, 'YesNo', 'Question')
if ($MsgBoxInput -eq 'Yes') {Return $true} else {Return $false}
}
# Show an information dialog
Function DialogSay {
param (
[string]$Title,
[string]$Message
)
[System.Windows.MessageBox]::Show($Message, $Title, 'OK', 'Information')
}