Skip to content

Commit 74d3f8e

Browse files
Merge pull request #6389 from FabienTschanz/fix/autolabelrule-workload
Update supported Workload values for SCAutoSensitivityLabelRule
2 parents 9c055c2 + e768b94 commit 74d3f8e

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
* Initial release.
1919
* IntuneMobileAppsWin32AppWindows10
2020
* Updated the property name of `autoUpdateSupersededApps` to `autoUpdateSupersededAppsState`.
21+
* SCAutoSensitivityLabelRule
22+
* Updated supported values for `Workload` property.
23+
FIXES [#4617](https://github.com/microsoft/Microsoft365DSC/issues/4617)
2124
* DEPENDENCIES
2225
* Updated ReverseDSC to version 2.0.0.29.
2326

Modules/Microsoft365DSC/DSCResources/MSFT_SCAutoSensitivityLabelRule/MSFT_SCAutoSensitivityLabelRule.psm1

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function Get-TargetResource
1616

1717
[Parameter(Mandatory = $true)]
1818
[System.String]
19-
[ValidateSet('Exchange', 'SharePoint', 'OneDriveForBusiness')]
19+
[ValidateSet('Exchange', 'SharePoint', 'OneDriveForBusiness', 'Applications', 'Azure', 'AWS', 'PowerBI')]
2020
$Workload,
2121

2222
[Parameter()]
@@ -402,7 +402,7 @@ function Set-TargetResource
402402

403403
[Parameter(Mandatory = $true)]
404404
[System.String]
405-
[ValidateSet('Exchange', 'SharePoint', 'OneDriveForBusiness')]
405+
[ValidateSet('Exchange', 'SharePoint', 'OneDriveForBusiness', 'Applications', 'Azure', 'AWS', 'PowerBI')]
406406
$Workload,
407407

408408
[Parameter()]
@@ -675,15 +675,7 @@ function Set-TargetResource
675675
$CreationParams.Remove('Ensure')
676676

677677
# Remove authentication parameters
678-
$CreationParams.Remove('Credential') | Out-Null
679-
$CreationParams.Remove('ApplicationId') | Out-Null
680-
$CreationParams.Remove('TenantId') | Out-Null
681-
$CreationParams.Remove('CertificatePath') | Out-Null
682-
$CreationParams.Remove('CertificatePassword') | Out-Null
683-
$CreationParams.Remove('CertificateThumbprint') | Out-Null
684-
$CreationParams.Remove('ManagedIdentity') | Out-Null
685-
$CreationParams.Remove('ApplicationSecret') | Out-Null
686-
$CreationParams.Remove('AccessTokens') | Out-Null
678+
$CreationParams = Remove-M365DSCAuthenticationParameter -BoundParameters $CreationParams
687679

688680
Write-Verbose -Message 'Flipping the parent policy to Mode = TestWithoutNotification while we create the rule'
689681
$parentPolicy = Get-AutoSensitivityLabelPolicy -Identity $Policy
@@ -697,7 +689,7 @@ function Set-TargetResource
697689
}
698690
New-AutoSensitivityLabelRule @CreationParams
699691

700-
Write-Verbose -Message "Flipping the parent policy to Mode back to $currentMode while we create the rule"
692+
Write-Verbose -Message "Flipping the parent policy back to Mode $currentMode while we create the rule"
701693
Set-AutoSensitivityLabelPolicy -Identity $Policy -Mode $currentMode
702694
}
703695
elseif (('Present' -eq $Ensure) -and ('Present' -eq $CurrentRule.Ensure))
@@ -745,15 +737,7 @@ function Set-TargetResource
745737
$UpdateParams.Add('Identity', $Name)
746738

747739
# Remove authentication parameters
748-
$UpdateParams.Remove('Credential') | Out-Null
749-
$UpdateParams.Remove('ApplicationId') | Out-Null
750-
$UpdateParams.Remove('TenantId') | Out-Null
751-
$UpdateParams.Remove('CertificatePath') | Out-Null
752-
$UpdateParams.Remove('CertificatePassword') | Out-Null
753-
$UpdateParams.Remove('CertificateThumbprint') | Out-Null
754-
$UpdateParams.Remove('ManagedIdentity') | Out-Null
755-
$UpdateParams.Remove('ApplicationSecret') | Out-Null
756-
$UpdateParams.Remove('AccessTokens') | Out-Null
740+
$UpdateParams = Remove-M365DSCAuthenticationParameter -BoundParameters $UpdateParams
757741

758742
Write-Verbose -Message 'Flipping the parent policy to Mode = TestWithoutNotification while we editing the rule'
759743
$parentPolicy = Get-AutoSensitivityLabelPolicy -Identity $Policy
@@ -793,7 +777,7 @@ function Test-TargetResource
793777

794778
[Parameter(Mandatory = $true)]
795779
[System.String]
796-
[ValidateSet('Exchange', 'SharePoint', 'OneDriveForBusiness')]
780+
[ValidateSet('Exchange', 'SharePoint', 'OneDriveForBusiness', 'Applications', 'Azure', 'AWS', 'PowerBI')]
797781
$Workload,
798782

799783
[Parameter()]
@@ -1663,4 +1647,3 @@ function Test-ContainsSensitiveInformationGroups
16631647
}
16641648

16651649
Export-ModuleMember -Function *-TargetResource
1666-

Modules/Microsoft365DSC/DSCResources/MSFT_SCAutoSensitivityLabelRule/MSFT_SCAutoSensitivityLabelRule.schema.mof

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class MSFT_SCAutoSensitivityLabelRule : OMI_BaseResource
8282
[Write, Description("The SentTo parameter specifies a condition for the auto-sensitivity policy rule that looks for recipients in messages. You can use any value that uniquely identifies the recipient.")] String SentTo[];
8383
[Write, Description("The SentToMemberOf parameter specifies a condition for the auto-labeling policy rule that looks for messages sent to members of distribution groups, dynamic distribution groups, or mail-enabled security groups. You identify the groups by email address.")] String SentToMemberOf[];
8484
[Write, Description("The SubjectMatchesPatterns parameter specifies a condition for the auto-labeling policy rule that looks for text patterns in the Subject field of messages by using regular expressions.")] String SubjectMatchesPatterns;
85-
[Key, Description("Workload the rule is associated with. Value can be: Exchange, SharePoint, OneDriveForBusiness"), ValueMap{"Exchange","SharePoint", "OneDriveForBusiness"}, Values{"Exchange","SharePoint", "OneDriveForBusiness"}] String Workload;
85+
[Key, Description("Workload the rule is associated with. Value can be: Exchange, SharePoint, OneDriveForBusiness, Applications, Azure, AWS and PowerBI"), ValueMap{"Exchange","SharePoint", "OneDriveForBusiness", "Applications", "Azure", "AWS", "PowerBI"}, Values{"Exchange","SharePoint", "OneDriveForBusiness", "Applications", "Azure", "AWS", "PowerBI"}] String Workload;
8686
[Write, Description("Specify if this rule should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
8787
[Write, Description("Credentials of the Exchange Global Admin"), EmbeddedInstance("MSFT_Credential")] string Credential;
8888
[Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId;

0 commit comments

Comments
 (0)