-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
- Loading branch information
Showing
7 changed files
with
179 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardBookings.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
function Invoke-CIPPStandardBookings { | ||
<# | ||
.FUNCTIONALITY | ||
Internal | ||
#> | ||
param($Tenant, $Settings) | ||
|
||
# Input validation | ||
if ([string]::isNullOrEmpty($Settings.state) -or $Settings.state -eq 'Select a value') { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message 'BookingsEnabled: Invalid state parameter set' -sev Error | ||
Exit | ||
} | ||
|
||
$CurrentState = (New-ExoRequest -tenantid $Tenant -cmdlet 'Get-OrganizationConfig').BookingsEnabled | ||
$WantedState = if ($Settings.state -eq 'true') { $true } else { $false } | ||
$StateIsCorrect = if ($CurrentState -eq $WantedState) { $true } else { $false } | ||
|
||
if ($Settings.remediate -eq $true) { | ||
Write-Host 'Time to remediate' | ||
if ($StateIsCorrect -eq $false) { | ||
try { | ||
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-OrganizationConfig' -cmdParams @{ BookingsEnabled = $WantedState } -useSystemMailbox $true | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "Successfully set the tenant Bookings state to $($Settings.state)" -sev Info | ||
} catch { | ||
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "Failed to set the tenant Bookings state to $($Settings.state). Error: $ErrorMessage" -sev Error | ||
} | ||
} else { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "The tenant Bookings state is already set correctly to $($Settings.state)" -sev Info | ||
} | ||
|
||
} | ||
|
||
if ($Settings.alert -eq $true) { | ||
if ($StateIsCorrect -eq $true) { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "The tenant Bookings is set correctly to $($Settings.state)" -sev Info | ||
} else { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "The tenant Bookings is not set correctly to $($Settings.state)" -sev Alert | ||
} | ||
} | ||
|
||
if ($Settings.report -eq $true) { | ||
# Default is not set, not set means it's enabled | ||
if ($null -eq $CurrentState ) { $CurrentState = $true } | ||
Add-CIPPBPAField -FieldName 'BookingsState' -FieldValue $CurrentState -StoreAs bool -Tenant $tenant | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardCloudMessageRecall.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
function Invoke-CIPPStandardCloudMessageRecall { | ||
<# | ||
.FUNCTIONALITY | ||
Internal | ||
#> | ||
param($Tenant, $Settings) | ||
|
||
# Input validation | ||
if ([string]::isNullOrEmpty($Settings.state) -or $Settings.state -eq 'Select a value') { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message 'MessageRecallEnabled: Invalid state parameter set' -sev Error | ||
Exit | ||
} | ||
|
||
$CurrentState = (New-ExoRequest -tenantid $Tenant -cmdlet 'Get-OrganizationConfig').MessageRecallEnabled | ||
$WantedState = if ($Settings.state -eq 'true') { $true } else { $false } | ||
$StateIsCorrect = if ($CurrentState -eq $WantedState) { $true } else { $false } | ||
|
||
if ($Settings.remediate -eq $true) { | ||
Write-Host 'Time to remediate' | ||
if ($StateIsCorrect -eq $false) { | ||
try { | ||
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-OrganizationConfig' -cmdParams @{ MessageRecallEnabled = $WantedState } -useSystemMailbox $true | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "Successfully set the tenant Message Recall state to $($Settings.state)" -sev Info | ||
} catch { | ||
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "Failed to set the tenant Message Recall state to $($Settings.state). Error: $ErrorMessage" -sev Error | ||
} | ||
} else { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "The tenant Message Recall state is already set correctly to $($Settings.state)" -sev Info | ||
} | ||
|
||
} | ||
|
||
if ($Settings.alert -eq $true) { | ||
if ($StateIsCorrect -eq $true) { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "The tenant Message Recall is set correctly to $($Settings.state)" -sev Info | ||
} else { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "The tenant Message Recall is not set correctly to $($Settings.state)" -sev Alert | ||
} | ||
} | ||
|
||
if ($Settings.report -eq $true) { | ||
# Default is not set, not set means it's enabled | ||
if ($null -eq $CurrentState ) { $CurrentState = $true } | ||
Add-CIPPBPAField -FieldName 'MessageRecall' -FieldValue $CurrentState -StoreAs bool -Tenant $tenant | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardTeamsMeetingsByDefault.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
function Invoke-CIPPStandardTeamsMeetingsByDefault { | ||
<# | ||
.FUNCTIONALITY | ||
Internal | ||
#> | ||
param($Tenant, $Settings) | ||
|
||
# Input validation | ||
if ([string]::isNullOrEmpty($Settings.state) -or $Settings.state -eq 'Select a value') { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message 'TeamsMeetingsByDefault: Invalid state parameter set' -sev Error | ||
Exit | ||
} | ||
|
||
$CurrentState = (New-ExoRequest -tenantid $Tenant -cmdlet 'Get-OrganizationConfig').OnlineMeetingsByDefaultEnabled | ||
$WantedState = if ($Settings.state -eq 'true') { $true } else { $false } | ||
$StateIsCorrect = if ($CurrentState -eq $WantedState) { $true } else { $false } | ||
|
||
if ($Settings.remediate -eq $true) { | ||
Write-Host 'Time to remediate' | ||
if ($StateIsCorrect -eq $false) { | ||
try { | ||
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-OrganizationConfig' -cmdParams @{ OnlineMeetingsByDefaultEnabled = $WantedState } -useSystemMailbox $true | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "Successfully set the tenant TeamsMeetingsByDefault state to $($Settings.state)" -sev Info | ||
} catch { | ||
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "Failed to set the tenant TeamsMeetingsByDefault state to $($Settings.state). Error: $ErrorMessage" -sev Error | ||
} | ||
} else { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "The tenant TeamsMeetingsByDefault state is already set correctly to $($Settings.state)" -sev Info | ||
} | ||
|
||
} | ||
|
||
if ($Settings.alert -eq $true) { | ||
if ($StateIsCorrect -eq $true) { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "The tenant TeamsMeetingsByDefault is set correctly to $($Settings.state)" -sev Info | ||
} else { | ||
Write-LogMessage -API 'Standards' -tenant $tenant -message "The tenant TeamsMeetingsByDefault is not set correctly to $($Settings.state)" -sev Alert | ||
} | ||
} | ||
|
||
if ($Settings.report -eq $true) { | ||
# Default is not set, not set means it's enabled | ||
if ($null -eq $CurrentState ) { $CurrentState = $true } | ||
Add-CIPPBPAField -FieldName 'TeamsMeetingsByDefault' -FieldValue $CurrentState -StoreAs bool -Tenant $tenant | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.7.3 | ||
5.7.4 |