Skip to content

Commit ac0cfa5

Browse files
Merge branch 'Dev' into fix/permissions
2 parents b3766b9 + bb8c22a commit ac0cfa5

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* IntuneDeviceCompliancePolicyAndroidDeviceOwner
1919
* Fixed an issue where a JSON serialization warning was outputted
2020
due to the object depth exceeding two levels.
21+
* O365OrgSettings
22+
* Added `CertificatePath` with `CertificatePassword` as an authentication method.
2123
* TeamsChannel
2224
* Updated required permissions for read / update.
2325
* TeamsEmergencyCallRoutingPolicy

Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ function Get-TargetResource
142142
[System.String]
143143
$CertificateThumbprint,
144144

145+
[Parameter()]
146+
[System.String]
147+
$CertificatePath,
148+
149+
[Parameter()]
150+
[System.Management.Automation.PSCredential]
151+
$CertificatePassword,
152+
145153
[Parameter()]
146154
[Switch]
147155
$ManagedIdentity,
@@ -193,6 +201,8 @@ function Get-TargetResource
193201
TenantId = $TenantId
194202
ApplicationSecret = $ApplicationSecret
195203
CertificateThumbprint = $CertificateThumbprint
204+
CertificatePath = $CertificatePath
205+
CertificatePassword = $CertificatePassword
196206
ManagedIdentity = $ManagedIdentity.IsPresent
197207
AccessTokens = $AccessTokens
198208
}
@@ -500,6 +510,14 @@ function Set-TargetResource
500510
[System.String]
501511
$CertificateThumbprint,
502512

513+
[Parameter()]
514+
[System.String]
515+
$CertificatePath,
516+
517+
[Parameter()]
518+
[System.Management.Automation.PSCredential]
519+
$CertificatePassword,
520+
503521
[Parameter()]
504522
[Switch]
505523
$ManagedIdentity,
@@ -913,6 +931,14 @@ function Test-TargetResource
913931
[System.String]
914932
$CertificateThumbprint,
915933

934+
[Parameter()]
935+
[System.String]
936+
$CertificatePath,
937+
938+
[Parameter()]
939+
[System.Management.Automation.PSCredential]
940+
$CertificatePassword,
941+
916942
[Parameter()]
917943
[Switch]
918944
$ManagedIdentity,
@@ -962,6 +988,14 @@ function Export-TargetResource
962988
[System.String]
963989
$CertificateThumbprint,
964990

991+
[Parameter()]
992+
[System.String]
993+
$CertificatePath,
994+
995+
[Parameter()]
996+
[System.Management.Automation.PSCredential]
997+
$CertificatePassword,
998+
965999
[Parameter()]
9661000
[Switch]
9671001
$ManagedIdentity,
@@ -1000,6 +1034,8 @@ function Export-TargetResource
10001034
TenantId = $TenantId
10011035
ApplicationSecret = $ApplicationSecret
10021036
CertificateThumbprint = $CertificateThumbprint
1037+
CertificatePath = $CertificatePath
1038+
CertificatePassword = $CertificatePassword
10031039
ManagedIdentity = $ManagedIdentity.IsPresent
10041040
AccessTokens = $AccessTokens
10051041
}

Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.schema.mof

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ClassVersion("1.0.0.1"), FriendlyName("O365OrgSettings")]
1+
[ClassVersion("1.0.0.2"), FriendlyName("O365OrgSettings")]
22
class MSFT_O365OrgSettings : OMI_BaseResource
33
{
44
[Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance;
@@ -34,6 +34,8 @@ class MSFT_O365OrgSettings : OMI_BaseResource
3434
[Write, Description("Id of the Azure Active Directory tenant used for authentication.")] String TenantId;
3535
[Write, Description("Secret of the Azure Active Directory tenant used for authentication."), EmbeddedInstance("MSFT_Credential")] String ApplicationSecret;
3636
[Write, Description("Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.")] String CertificateThumbprint;
37+
[Write, Description("Username can be made up to anything but password will be used for CertificatePassword"), EmbeddedInstance("MSFT_Credential")] String CertificatePassword;
38+
[Write, Description("Path to certificate used in service principal usually a PFX file.")] String CertificatePath;
3739
[Write, Description("Managed ID being used for authentication.")] Boolean ManagedIdentity;
3840
[Write, Description("Access token used for authentication.")] String AccessTokens[];
3941
};

Modules/Microsoft365DSC/Modules/M365DSCReverse.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ function Start-M365DSCConfigurationExtract
618618
}
619619

620620
# Retrieve the list of Workloads represented by the resources to export and pre-authenticate to each one;
621-
if ($ResourcesToExport.Length -gt 0)
621+
if ($ResourcesToExport.Count -gt 0)
622622
{
623623
$WorkloadsToConnectTo = Get-M365DSCConnectedWorkloadList -ResourceNames $ResourcesToExport
624624
}

0 commit comments

Comments
 (0)