Skip to content

Commit 2cd93fb

Browse files
authored
Merge pull request #401 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 7304d42 + f13462d commit 2cd93fb

25 files changed

+37
-29
lines changed

Modules/CIPPCore/Public/Functions/Get-CIPPTenantAlignment.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function Get-CIPPTenantAlignment {
5252

5353
# Get standards comparison data
5454
$StandardsTable = Get-CIPPTable -TableName 'CippStandardsReports'
55-
$AllStandards = Get-CIPPAzDataTableEntity @StandardsTable -Filter "PartitionKey ne 'StandardReport'"
55+
$AllStandards = Get-CIPPAzDataTableEntity @StandardsTable -Filter "PartitionKey ne 'StandardReport' and PartitionKey ne ''"
5656

5757
# Filter by tenant if specified
5858
$Standards = if ($TenantFilter) {
@@ -72,7 +72,15 @@ function Get-CIPPTenantAlignment {
7272
if ($FieldValue -is [System.Boolean]) {
7373
$FieldValue = [bool]$FieldValue
7474
} elseif ($FieldValue -like '*{*') {
75-
$FieldValue = ConvertFrom-Json -Depth 100 -InputObject $FieldValue -ErrorAction SilentlyContinue
75+
try {
76+
$FieldValue = ConvertFrom-Json -Depth 100 -InputObject $FieldValue -ErrorAction SilentlyContinue
77+
} catch {
78+
Write-Warning "$($FieldName) standard report could not be loaded: $($_.Exception.Message)"
79+
$FieldValue = [PSCustomObject]@{
80+
Error = "Invalid JSON format: $($_.Exception.Message)"
81+
OriginalValue = $FieldValue
82+
}
83+
}
7684
} else {
7785
$FieldValue = [string]$FieldValue
7886
}

Modules/CIPPCore/Public/New-CIPPUserTask.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ function New-CIPPUserTask {
3030
value = 'Set-CIPPUserLicense'
3131
}
3232
Parameters = [pscustomobject]@{
33-
UserId = $UserObj.id
33+
UserId = $CreationResults.Username
3434
APIName = 'Sherweb License Assignment'
35-
AddLicenses = $licenses
35+
AddLicenses = $UserObj.licenses.value
3636
}
3737
ScheduledTime = 0 #right now, which is in the next 15 minutes and should cover most cases.
3838
PostExecution = @{

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardAtpPolicyForO365.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Invoke-CIPPStandardAtpPolicyForO365 {
3131
#>
3232

3333
param($Tenant, $Settings)
34-
$TestResult = Test-CIPPStandardLicense -StandardName 'AtpPolicyForO365' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
34+
$TestResult = Test-CIPPStandardLicense -StandardName 'AtpPolicyForO365' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'SHAREPOINTENTERPRISE_EDU', 'ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
3535
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'AtpPolicyForO365'
3636

3737
if ($TestResult -eq $false) {
@@ -40,7 +40,7 @@ function Invoke-CIPPStandardAtpPolicyForO365 {
4040
} #we're done.
4141
try {
4242
$CurrentState = New-ExoRequest -tenantid $Tenant -cmdlet 'Get-AtpPolicyForO365' |
43-
Select-Object EnableATPForSPOTeamsODB, EnableSafeDocs, AllowSafeDocsOpen
43+
Select-Object EnableATPForSPOTeamsODB, EnableSafeDocs, AllowSafeDocsOpen
4444
} catch {
4545
$CurrentState = @{
4646
License = 'This tenant might not be licensed for this feature'

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDefaultSharingLink.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function Invoke-CIPPStandardDefaultSharingLink {
3030
#>
3131

3232
param($Tenant, $Settings)
33-
$TestResult = Test-CIPPStandardLicense -StandardName 'DefaultSharingLink' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
33+
$TestResult = Test-CIPPStandardLicense -StandardName 'DefaultSharingLink' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'SHAREPOINTENTERPRISE_EDU','ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
3434

3535
# Determine the desired sharing link type (default to Internal if not specified)
3636

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDeletedUserRentention.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function Invoke-CIPPStandardDeletedUserRentention {
2929
#>
3030

3131
param($Tenant, $Settings)
32-
$TestResult = Test-CIPPStandardLicense -StandardName 'DeletedUserRentention' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
32+
$TestResult = Test-CIPPStandardLicense -StandardName 'DeletedUserRentention' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'SHAREPOINTENTERPRISE_EDU','ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
3333
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'DeletedUserRetention'
3434

3535
if ($TestResult -eq $false) {

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDisableAddShortcutsToOneDrive.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function Invoke-CIPPStandardDisableAddShortcutsToOneDrive {
2929
#>
3030

3131
param($Tenant, $Settings)
32-
$TestResult = Test-CIPPStandardLicense -StandardName 'DisableAddShortcutsToOneDrive' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
32+
$TestResult = Test-CIPPStandardLicense -StandardName 'DisableAddShortcutsToOneDrive' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'SHAREPOINTENTERPRISE_EDU','ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
3333
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'DisableAddShortcutsToOneDrive'
3434

3535
if ($TestResult -eq $false) {

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDisableM365GroupUsers.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function Invoke-CIPPStandardDisableM365GroupUsers {
2828
#>
2929

3030
param($Tenant, $Settings)
31-
$TestResult = Test-CIPPStandardLicense -StandardName 'DisableM365GroupUsers' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
31+
$TestResult = Test-CIPPStandardLicense -StandardName 'DisableM365GroupUsers' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'SHAREPOINTENTERPRISE_EDU','ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
3232
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'DisableM365GroupUsers'
3333

3434
if ($TestResult -eq $false) {

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDisableReshare.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Invoke-CIPPStandardDisableReshare {
3131
#>
3232

3333
param($Tenant, $Settings)
34-
$TestResult = Test-CIPPStandardLicense -StandardName 'DisableReshare' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
34+
$TestResult = Test-CIPPStandardLicense -StandardName 'DisableReshare' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'SHAREPOINTENTERPRISE_EDU','ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
3535
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'DisableReshare'
3636

3737
if ($TestResult -eq $false) {

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDisableSharePointLegacyAuth.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function Invoke-CIPPStandardDisableSharePointLegacyAuth {
3232
#>
3333

3434
param($Tenant, $Settings)
35-
$TestResult = Test-CIPPStandardLicense -StandardName 'DisableSharePointLegacyAuth' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
35+
$TestResult = Test-CIPPStandardLicense -StandardName 'DisableSharePointLegacyAuth' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'SHAREPOINTENTERPRISE_EDU','ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
3636
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'DisableSharePointLegacyAuth'
3737

3838
if ($TestResult -eq $false) {

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDisableUserSiteCreate.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function Invoke-CIPPStandardDisableUserSiteCreate {
2828
#>
2929

3030
param($Tenant, $Settings)
31-
$TestResult = Test-CIPPStandardLicense -StandardName 'DisableUserSiteCreate' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
31+
$TestResult = Test-CIPPStandardLicense -StandardName 'DisableUserSiteCreate' -TenantFilter $Tenant -RequiredCapabilities @('SHAREPOINTWAC', 'SHAREPOINTSTANDARD', 'SHAREPOINTENTERPRISE', 'SHAREPOINTENTERPRISE_EDU','ONEDRIVE_BASIC', 'ONEDRIVE_ENTERPRISE')
3232
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'DisableUserSiteCreate'
3333

3434
if ($TestResult -eq $false) {

0 commit comments

Comments
 (0)