-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathLauncher.ps1
More file actions
642 lines (569 loc) · 24.3 KB
/
Launcher.ps1
File metadata and controls
642 lines (569 loc) · 24.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
### M365 Configuration Launcher
# Verify/Elevate Admin Session.
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
exit
}
# Set the MaximumFunctionCount
$MaximumFunctionCount = 32768
# Directly set the MaximumFunctionCount using $ExecutionContext
try {
$executionContext.SessionState.PSVariable.Set('MaximumFunctionCount', $MaximumFunctionCount)
}
catch {
Write-Error "Failed to set MaximumFunctionCount: $_"
exit
}
# Check PowerShell version
if ($PSVersionTable.PSVersion.Major -lt 5) {
Write-Host "This script requires PowerShell 5.1 or later. Your version is $($PSVersionTable.PSVersion). Please upgrade PowerShell and try again." -ForegroundColor Red
exit
}
# Import required modules
Import-Module Microsoft.PowerShell.Utility
# Initialize variables
$scriptPath = $PSScriptRoot
$logFile = Join-Path $PSScriptRoot "Launcher_$(Get-Date -Format 'yyyyMMdd_HHmmss').log"
$configFile = Join-Path $PSScriptRoot "config.json"
# Modules Required
$Global:Modules = @(
"ExchangeOnlineManagement"
"AzureADPreview"
"MSOnline"
"MSGRAPH"
"Microsoft.Graph"
"AIPService"
"MicrosoftTeams"
"Microsoft.Online.SharePoint.PowerShell"
)
# Function to write log messages
function Write-Log {
param (
[string]$Message,
[string]$Level = "INFO"
)
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$logMessage = "[$timestamp] [$Level] $Message"
Add-Content -Path $logFile -Value $logMessage
Write-Host $logMessage
}
Write-Log "Starting up the M365 Configurator..." "INFO"
# Random String Generation for Passwords
function genRandString ([int]$length, [string]$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%()') {
return -join ((1..$length) | ForEach-Object { Get-Random -InputObject $chars.ToCharArray() })
}
# Function to load and validate configuration
function Load-Configuration {
if (Test-Path $configFile) {
Write-Output "Loading configuration from $configFile"
$config = Get-Content $configFile -Raw | ConvertFrom-Json
if (-not $config.ScriptPaths) {
throw "Configuration file does not contain ScriptPaths. Unable to proceed."
}
}
# Creating new config file with default values
else {
Write-Log "Configuration file not found. Generating new one with DEFAULT values.." "WARNING"
Write-Host
# Gather some details
Write-Host "Enter a one-word name of your MSP, with NO spaces or symbols (Example: Umbrella or UmbrellaIT)" -ForegroundColor DarkYellow
$Global:mspName = Read-Host
Write-Host
# Alerts Address
Write-Host "Enter the Alerting Mailbox Address for your MSP (Example: alerting@umbrellaitgroup.com)" -ForegroundColor DarkYellow
$Global:mspAlertsAddress = Read-Host
Write-Host
# Support Address
Write-Host "Enter the Support Email Mailbox Address for your MSP (Example: support@umbrellaitgroup.com)" -ForegroundColor DarkYellow
$Global:MSPSupportMail = Read-Host
Write-Host
# MSP Info
Write-Host "Enter Information for your MSP in one line (Example: Umbrella IT Group (904) 930-4261 )" -ForegroundColor DarkYellow
$Global:MSPSupportInfo = Read-Host
Write-Host
# Logo URL
Write-Host "Enter the URL for the logo of the company. Leave blank for no logo." -ForegroundColor DarkYellow
Write-Host "Accepted file types for logo are .jpeg,.jpg,.gif,.png." -ForegroundColor DarkYellow
$CompanyLogo = Read-Host
Write-Host
# New Password for BreakGlass
$BGUserPWString = genRandString 25
$config = @{
BreakGlassAccountPass = $BGUserPWString
MSPAlertsAddress = $Global:mspAlertsAddress
MSPName = $Global:mspName
MSPSupportMail = $Global:MSPSupportMail
MSPSupportInfo = $Global:MSPSupportInfo
AdminAccessToMailboxes = $true
DisableFocusedInbox = $true
DisableSecurityDefaults = $true
DeleteStaleDevices = $true
StaleDeviceThresholdDays = 90
AuditLogAgeLimit = 730
DevicePilotGroupName = "Pilot-DeviceCompliance"
GroupCreatorsGroupName = "Group Creators"
GuestCreatorAdminsGroupName = "Guest Creators"
ExcludeFromCAGroupName = "Exclude From CA"
AllowedAutoForwardingGroup = "AutoForwarding-Allowed"
Language = "en-US"
Timezone = "Eastern Standard Time"
LogoURL = $CompanyLogo
TeamsConfig = @{
AllowOrgWideTeamCreation = $false
AllowFederatedUsers = $true
AllowTeamsConsumer = $false
AllowTeamsConsumerInbound = $false
AllowGuestAccess = $true
DisableAnonymousJoin = $true
AllowBox = $false
AllowDropBox = $false
AllowEgnyte = $false
AllowEmailIntoChannel = $true
AllowGoogleDrive = $false
}
SharePointOneDriveConfig = @{
OneDriveStorageQuota = 1048576
SharingCapability = "ExternalUserAndGuestSharing"
DefaultSharingLinkType = "Internal"
PreventExternalUsersFromResharing = $true
BccExternalSharingInvitations = $true
}
CompliancePolicies = @{
EmailRetentionYears = 10
SharePointOneDriveRetentionYears = 10
}
ScriptPaths = @{
DLPConfig = "DataLossPrevention\DLPConfig.ps1"
ModuleUpdater = "M365ModuleUpdater\M365ModuleUpdater.ps1"
TenantExchangeConfig = "TenantExchangeConfig\TenantExchangeConfig.ps1"
ModuleConnector = "M365ModuleConnector\M365ModuleConnector.ps1"
ATPConfig = "AdvancedThreatProtection\ATPConfig.ps1"
}
}
$Config | ConvertTo-Json | Out-File "$scriptPath\config.json"
# Optional Exit / Confirmation
Clear-Host
Write-Host
Write-Host "A new config file [config.json] has been generated and placed at script root (Same directory as this Launcher script)." -ForegroundColor DarkYellow
Write-Host
Write-Host "The password for your BreakGlass account will be (no spaces): $BGUserPWString" -ForegroundColor Green
Write-Host
Write-Host "This password is also recorded in the config file."-ForegroundColor DarkGreen
Write-Host "Be sure to delete this file and change the password when you are finished." -ForegroundColor DarkGreen
Write-Host
Write-Host "Press any button to continue, or exit script (Ctrl-C) to review the config file before proceeding (See README)" -ForegroundColor DarkYellow
Read-Host
write-title
}
return $config
}
# Function to display menu and get user choice
function Show-Menu {
param (
[string]$Title = 'M365 Configuration Menu'
)
Write-Host
Write-Host "================ $Title ================" -ForegroundColor DarkCyan
Write-Host
Write-Host "R: Refresh Connections"
Write-Host "1: Install and Update Required Modules"
Write-Host "2: Connect All Modules to M365 Tenant"
Write-Host "3: Configure M365 Tenant and Exchange Online"
Write-Host "4: Configure ATP (Advanced Threat Protection)"
Write-Host "5: Configure DLP (Data Loss Prevention)"
Write-Host "Q: Quit - Consolidate logs, Disconnect Sessions"
Write-Host
}
# Function to run a script with error handling and logging
function Run-Script {
param (
[string]$ScriptPath,
[string]$ScriptName
)
Write-Log "Starting $ScriptName" "INFO"
try {
if (Test-Path $ScriptPath) {
& $ScriptPath
Write-Host
Write-Log "$ScriptName completed successfully" "INFO"
}
else {
Write-Log "Error: $ScriptName not found at $ScriptPath" "ERROR"
}
}
catch {
# Fixed line: Properly expanding variables in the error message
Write-Log "Error executing $ScriptName : $($_.Exception.Message)" "ERROR"
}
}
# Function to combine and consilidate log files generated by the scripts
function Consolidate-LogFiles {
# Get the current date and time for the new log file name
$dateTime = Get-Date -Format "yyyyMMdd_HH-mm"
# Create the new log file name, using "noTenant" if $Global:TenantDomain is null
$tenantName = if ($null -eq $Global:TenantDomain) { "noTenant" } else { $Global:TenantDomain }
$newLogFileName = "${tenantName}_${dateTime}.log"
$newLogFilePath = Join-Path $PSScriptRoot $newLogFileName
# Get all directories from the config file, fallback to script root if empty
$directories = @($PSScriptRoot)
if ($null -ne $config -and $null -ne $config.ScriptPaths -and $config.ScriptPaths.Count -gt 0) {
$configDirs = $config.ScriptPaths.Values | Where-Object { $_ -ne $null } | ForEach-Object { Split-Path -Parent $_ } | Select-Object -Unique
if ($configDirs.Count -gt 0) {
$directories = $configDirs
}
}
# Initialize an array to store all log entries
$allLogEntries = @()
# Search for log files in all directories and subdirectories
foreach ($directory in $directories) {
if (Test-Path $directory) {
$logFiles = Get-ChildItem -Path $directory -Recurse -Filter "*.log"
foreach ($logFile in $logFiles) {
$content = Get-Content $logFile.FullName
$allLogEntries += $content
}
}
else {
Write-Host "Directory not found: $directory" -ForegroundColor Yellow
}
}
# Sort all entries chronologically and remove duplicates
$uniqueSortedEntries = $allLogEntries | Sort-Object -Unique
# Write the consolidated entries to the new log file
$uniqueSortedEntries | Set-Content $newLogFilePath
Write-Host "Consolidated log file created: $newLogFilePath" -ForegroundColor Green
# Delete all old log files, excluding the newly created consolidated log
foreach ($directory in $directories) {
if (Test-Path $directory) {
$logFiles = Get-ChildItem -Path $directory -Recurse -Filter "*.log" | Where-Object { $_.FullName -ne $newLogFilePath }
foreach ($logFile in $logFiles) {
Remove-Item $logFile.FullName -Force
Write-Host "Deleted old log file: $($logFile.FullName)" -ForegroundColor Yellow
}
}
}
Write-Host "Log consolidation complete. Old log files have been deleted." -ForegroundColor Green
}
# Function to check existing connections
function Check-ExistingConnections {
$connections = @()
$DisplayConnections = @()
# Check Config File
try {
$config = Get-Content $configFile -Raw -ErrorAction Stop | ConvertFrom-Json
if ($config.MSPName) {
$connections += "Config File"
$DisplayConnections += "Config File"
}
}
catch {
Write-Log "CRITICAL: Config file not found" "ERROR"
Load-Configuration
}
# Check Exchange Online Management connection
try {
$exchangeConnection = Get-Module -Name ExchangeOnlineManagement -ListAvailable
if ($exchangeConnection) {
$tenantInfo = Get-OrganizationConfig -ErrorAction Stop
$connections += "ExchangeOnlineManagement"
$DisplayConnections += "Exchange Online (Tenant: $($tenantInfo.DisplayName))"
}
}
catch {
Write-Host " - Not connected to Exchange Online"
}
# Check Security and Compliance Center connection
try {
Get-ComplianceSearch -ErrorAction Stop
$connections += "IPPSSession"
$DisplayConnections += "Security and Compliance Center"
}
catch {
Write-Host " - Not connected to Security & Compliance Center"
}
# Check Azure AD connection
try {
$azureADInfo = Get-AzureADTenantDetail -ErrorAction Stop
$connections += "AzureADPreview"
$DisplayConnections += "Azure AD (Tenant: $($azureADInfo.DisplayName))"
}
catch {
Write-Host " - Not connected to Azure AD"
}
# Check MSOnline connection
try {
$msolCompanyInfo = Get-MsolCompanyInformation -ErrorAction Stop
$connections += "MSOnline"
$DisplayConnections += "MSOnline (Tenant: $($msolCompanyInfo.DisplayName))"
}
catch {
Write-Host " - Not connected to MSOnline"
}
# Check Teams connection
try {
$teamsConnection = Get-CsOnlineUser -ResultSize 1 -ErrorAction Stop
if ($teamsConnection) {
$tenantInfo = (Get-CsTenant).TenantId
$connections += "MicrosoftTeams"
$DisplayConnections += "Teams (Tenant ID: $tenantInfo)"
}
}
catch {
Write-Host " - Not connected to Microsoft Teams"
}
# Check SharePoint Online connection
try {
$spoConnection = Get-SPOSite -Limit ALL -ErrorAction Stop
if ($spoConnection) {
$connections += "Microsoft.Online.SharePoint.PowerShell"
$DisplayConnections += "SharePoint"
}
}
catch {
Write-Host " - Not connected to SharePoint Online"
}
# Check MS Graph connection
try {
$graphConnection = Invoke-GraphRequest -Uri "https://graph.microsoft.com/v1.0/me" -ErrorAction Stop
if ($graphConnection) {
$tenantInfo = (Invoke-GraphRequest -Uri "https://graph.microsoft.com/v1.0/organization").value[0]
$connections += "MSGRAPH"
$DisplayConnections += "MS Graph (old) (Tenant: $($tenantInfo.DisplayName))"
}
}
catch {
Write-Host " - Not connected to MS Graph"
}
# Check Microsoft.Graph connection
try {
$graphInfo = Get-MgOrganization -ErrorAction Stop
$connections += "Microsoft.Graph"
$DisplayConnections += "MG Graph (new) (Tenant: $($graphInfo.DisplayName))"
}
catch {
Write-Host " - Not connected to Microsoft.Graph"
}
# Check AIPService connection
try {
$aipConnection = Get-AIPServiceConfiguration -ErrorAction Stop
if ($aipConnection) {
$connections += "AIPService"
$DisplayConnections += "AIPService"
}
}
catch {
Write-Host " - Not connected to AIPService"
}
#return $connections
return $DisplayConnections
}
# Function to Compare Necessary Connections
function Check-AllNecessaryConnections {
$necessaryConnections = @(
"Exchange Online",
"Security and Compliance Center",
"Azure AD",
"MSOnline",
"Teams",
"SharePoint",
"MS Graph (old)",
"MG Graph (new)",
"AIPService"
)
$missingConnections = @()
foreach ($connection in $necessaryConnections) {
if (-not ($Global:existingConnections | Where-Object { $_ -like "*$connection*" })) {
$missingConnections += $connection
}
}
if ($missingConnections.Count -eq 0) {
return $true
}
else {
return $missingConnections
}
}
# Function to display existing connections and prompt for action
function Prompt-ExistingConnections {
$Global:existingConnections = Check-ExistingConnections
if ($Global:existingConnections.Count -gt 1) {
Write-Host
Write-Host "Prerequisites Established:"
$Global:existingConnections | ForEach-Object { Write-Host " - $_" -ForegroundColor Cyan }
Write-Host
Write-Log "Proceeding with established connections." "INFO"
}
else {
Write-Host
Write-Host
Write-Log "No existing tenant connections detected." "WARNING"
}
# Admin/Tenant in Use
if ($null -eq $Global:Credential) {
Write-Log "No Admin Account being used" "WARNING"
}
else {
#Set Tenant Domain and ID
$Global:TenantDomain = $Global:Credential.UserName.Split('@')[1].Split('.')[0]
try {
$Global:TenantID = (Get-CsTenant).TenantId
}
catch {
$Global:TenantID = "CRITICAL ERROR"
}
Write-Log "Established Creds to $Global:TenantDomain with $($Global:Credential.UserName)" "INFO"
Write-Host
Write-Host "Global Variables" -ForegroundColor DarkGreen
Write-Host " -= Tenant: $Global:TenantDomain" -ForegroundColor DarkGreen
Write-Host " -= Tenant ID : $Global:TenantID" -ForegroundColor DarkGreen
Write-Host " -= Credential: $($Global:Credential.UserName)" -ForegroundColor DarkGreen
}
# Check if all necessary connections are established and set global variable
$Global:connectionCheck = Check-AllNecessaryConnections
if ($Global:connectionCheck -eq $true) {
Write-Host
Write-Host " All necessary connections are established! Proceed with Configuration." -ForegroundColor Green
}
else {
Write-Host
Write-Host
Write-Host "Some required module connections are missing:" -ForegroundColor Yellow
$Global:connectionCheck | ForEach-Object { Write-Host " - $_" -ForegroundColor Yellow }
}
}
# Function to disconnect from all open connections
function Close-ExistingConnections {
Write-Host "Disconnecting all sessions..." -ForegroundColor Yellow
Write-Host
# Exchange Online
if (Get-PSSession | Where-Object { $_.ConfigurationName -eq "Microsoft.Exchange" }) {
Disconnect-ExchangeOnline -Confirm:$false -ErrorAction SilentlyContinue
Write-Host " - Disconnected from Exchange Online" -ForegroundColor DarkYellow
}
# Security & Compliance Center
if (Get-PSSession | Where-Object { $_.ConfigurationName -eq "Microsoft.Exchange" -and $_.ComputerName -eq "ps.compliance.protection.outlook.com" }) {
Get-PSSession | Where-Object { $_.ConfigurationName -eq "Microsoft.Exchange" -and $_.ComputerName -eq "ps.compliance.protection.outlook.com" } | Remove-PSSession -ErrorAction SilentlyContinue
Write-Host " - Disconnected from Security & Compliance Center" -ForegroundColor DarkYellow
}
# Azure AD
if (Get-Module -Name AzureAD -ListAvailable) {
Disconnect-AzureAD -Confirm:$false -ErrorAction SilentlyContinue
Write-Host " - Disconnected from Azure AD" -ForegroundColor DarkYellow
}
# MSOnline
if (Get-Module -Name MSOnline -ListAvailable) {
# MSOnline doesn't have a disconnect cmdlet, so we'll just remove the module
Remove-Module -Name MSOnline -Force -ErrorAction SilentlyContinue
Write-Host " - Disconnected from MSOnline" -ForegroundColor DarkYellow
}
# Teams
if (Get-Module -Name MicrosoftTeams -ListAvailable) {
Disconnect-MicrosoftTeams -Confirm:$false -ErrorAction SilentlyContinue
Write-Host " - Disconnected from Microsoft Teams" -ForegroundColor DarkYellow
}
# SharePoint Online
if (Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable) {
try {
$spSession = Get-SPOSession -ErrorAction SilentlyContinue
if ($spSession) {
Disconnect-SPOService -ErrorAction SilentlyContinue
Write-Host " - Disconnected from SharePoint Online" -ForegroundColor DarkYellow
}
}
catch {
# Do nothing, as we're suppressing errors
}
}
# Microsoft Graph (old)
if (Get-Module -Name Microsoft.Graph.Authentication -ListAvailable) {
Disconnect-Graph -ErrorAction SilentlyContinue
Write-Host " - Disconnected from MS Graph (old)" -ForegroundColor DarkYellow
}
# Microsoft Graph (new)
if (Get-Module -Name Microsoft.Graph -ListAvailable) {
Disconnect-MgGraph -ErrorAction SilentlyContinue
Write-Host " - Disconnected from MG Graph (new)" -ForegroundColor DarkYellow
}
# AIPService
if (Get-Module -Name AIPService -ListAvailable) {
Disconnect-AipService -ErrorAction SilentlyContinue
Write-Host " - Disconnected from AIPService" -ForegroundColor DarkYellow
}
# Clear all remaining PS Sessions
Get-PSSession | Remove-PSSession -ErrorAction SilentlyContinue
# Remove all imported modules
Get-Module | Where-Object { $_.ModuleType -eq "Script" } | Remove-Module -Force -ErrorAction SilentlyContinue
Write-Host
Write-Log "All connections have been closed." "INFO"
}
# Main Title Function
function write-title {
Clear-Host
Write-Host " .___ ___. ____ __ _____ "
Write-Host " | \/ | |___ \ / / | ____| "
Write-Host " | \ / | __) | / /_ | |__ "
Write-Host " | |\/| | |__ < | '_ \ |___ \ "
Write-Host " | | | | ___) | | (_) | ___) | "
Write-Host " |__| |__| |____/ \___/ |____/ "
Write-Host " "
Write-Host " ______ ______ .__ __. _______ __ _______ __ __ .______ ___ .___________. ______ .______ "
Write-Host " / | / __ \ | \ | | | ____|| | / _____|| | | | | _ \ / \ | | / __ \ | _ \ "
Write-Host " | ,----'| | | | | \| | | |__ | | | | __ | | | | | |_) | / ^ \ '---| |----'| | | | | |_) | "
Write-Host " | | | | | | | . ' | | __| | | | | |_ | | | | | | / / /_\ \ | | | | | | | / "
Write-Host " | '----.| '--' | | |\ | | | | | | |__| | | '--' | | |\ \----./ _____ \ | | | '--' | | |\ \----. "
Write-Host " \______| \______/ |__| \__| |__| |__| \______| \______/ | _| '._____/__/ \__\ |__| \______/ | _| '._____| "
Write-Host
Write-Host
Write-Host " Created by Alex Ivantsov @Exploitacious "
Write-Host
}
##################################################
### Main script logic
##################################################
# Load configuration
$config = Load-Configuration
write-title
# Menu Loop
do {
Write-Host
Write-Host
Write-Host "Checking for connections..."
Write-Host
Prompt-ExistingConnections
Write-Host
Write-Host
Show-Menu
$input = Read-Host "Please make a selection"
switch ($input) {
'r' {
#Refresh the Menu Loop
continue
}
'1' {
Run-Script $config.ScriptPaths.ModuleUpdater "Module Updater"
}
'2' {
Run-Script $config.ScriptPaths.ModuleConnector "Module Connector"
}
'3' {
Run-Script $config.ScriptPaths.TenantExchangeConfig "Tenant and Exchange Configuration"
}
'4' { Run-Script $config.ScriptPaths.ATPConfig "ATP Configuration" }
'5' { Run-Script $config.ScriptPaths.DLPConfig "DLP Configuration" }
'q' {
Write-Log "Wrapping up, please be patient..." "INFO"
Write-Host
Close-ExistingConnections
$Global:existingConnections = $null
$Global:Credential = $null
$Global:Modules = $null
Consolidate-LogFiles
}
}
pause
}
until ($input -eq 'q')
Write-Host
Write-Host "Use the log file for information regarding the work completed for the work/time/ticket entry."
Write-Host
Read-Host "Press any key to exit"