Skip to content

Commit 939fba2

Browse files
Merge pull request #6418 from microsoft/Dev
Release 1.25.806.1
2 parents 16f153c + 8f78a67 commit 939fba2

File tree

66 files changed

+6989
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+6989
-237
lines changed

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
11
# Change log for Microsoft365DSC
22

3+
# 1.25.806.1
4+
5+
* AADApplication
6+
* Fixed an issue where not all properties were exported.
7+
* AADAuthenticationMethodPolicyFido2
8+
* Fixed an issue where the policy was not updated properly.
9+
FIXES [#6391](https://github.com/microsoft/Microsoft365DSC/issues/6391)
10+
* AADCrossTenantAccessPolicyConfigurationDefault
11+
* Fixed an issue where the export returns an invalid value for `Targets`.
12+
FIXES [#6397](https://github.com/microsoft/Microsoft365DSC/issues/6397)
13+
* AADEntitlementManagementAccessPackage
14+
* Fixed an issue where `AccessPackagesIncompatibleWith` would not be populated with a value.
15+
FIXES [#5063](https://github.com/microsoft/Microsoft365DSC/issues/5063)
16+
* AADServicePrincipal
17+
* Fixes for retrieving instance by name.
18+
* AADUser
19+
* Added support for Mail attribute.
20+
* EXOOrganizationConfig
21+
* Added support for the RejectDirectSend property.
22+
* FabricAdminTenantSettings
23+
* Fixed the export of the resource.
24+
FIXES [#6345](https://github.com/microsoft/Microsoft365DSC/issues/6345)
25+
* IntuneMobileAppsLobAppiOS
26+
* Initial release.
27+
* IntuneMobileAppsLobAppAndroid
28+
* Initial release.
29+
* IntuneMobileAppsLobAppWindows10
30+
* Initial release.
31+
* IntuneMobileAppsLobAppMsiWindows10
32+
* Initial release.
33+
* IntuneMobileAppsWin32AppWindows10
34+
* Updated the property name of `autoUpdateSupersededApps` to `autoUpdateSupersededAppsState`.
35+
* SCAutoSensitivityLabelRule
36+
* Updated supported values for `Workload` property.
37+
FIXES [#4617](https://github.com/microsoft/Microsoft365DSC/issues/4617)
38+
* SCSensitivityLabel
39+
* Reduced export time by 90%
40+
* TeamsEventsPolicy
41+
* Added 7 new properties.
42+
FIXES [#6403](https://github.com/microsoft/Microsoft365DSC/issues/6403)
43+
* M365DSCResourceGenerator
44+
* Fixed an issue where duplicate parameters would lead to an error during generation.
45+
FIXES [#5489](https://github.com/microsoft/Microsoft365DSC/issues/5489)
46+
* DEPENDENCIES
47+
* Updated ReverseDSC to version 2.0.0.29.
48+
349
# 1.25.730.1
450

551
* AADServicePrincipal

Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Confirm-M365DSCModuleDependency -ModuleName 'MSFT_AADApplication'
2-
$Script:PropertiesToRetrieve = "displayName, description, groupMembershipClaims, web, api, id, appId, applicationTemplateId, signInAudience, authenticationBehaviors, keyCredentials, requiredResourceAccess"
2+
$Script:PropertiesToRetrieve = "appRoles, identifierUris, displayName, description, groupMembershipClaims, optionalClaims, web, api, id, appId, spa, applicationTemplateId, signInAudience, authenticationBehaviors, isFallbackPublicClient, publicClient, keyCredentials, passwordCredentials, requiredResourceAccess"
33

44
function Get-TargetResource
55
{
@@ -544,7 +544,6 @@ function Get-TargetResource
544544
AccessTokens = $AccessTokens
545545
}
546546

547-
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
548547
return $result
549548
}
550549
catch
@@ -1232,10 +1231,9 @@ function Set-TargetResource
12321231
}
12331232
}
12341233

1235-
Write-Verbose -Message "Updating permissions for Azure AD Application {$($currentAADApp.DisplayName)} with RequiredResourceAccess:`r`n$($allRequiredAccess | Out-String)"
1236-
Write-Verbose -Message "ResourceAccess:`r`n$($allRequiredAccess.ResourceAccess | Out-String)"
1234+
Write-Verbose -Message "Updating permissions for Azure AD Application {$($currentAADApp.DisplayName)} with RequiredResourceAccess:`r`n$($allRequiredAccess | ConvertTo-Json -Depth 10)"
12371235
Write-Verbose -Message "Current App Id: $($currentAADApp.AppId)"
1238-
1236+
Write-Verbose -Message "Current ObjectId: $($currentAADApp.Id)"
12391237
# Even if the property is named ApplicationId, we need to pass in the ObjectId
12401238
Update-MgApplication -ApplicationId ($currentAADApp.Id) `
12411239
-RequiredResourceAccess $allRequiredAccess | Out-Null
@@ -1594,7 +1592,6 @@ function Export-TargetResource
15941592
$Results = Get-TargetResource @Params
15951593
if ($Results.Ensure -eq 'Present')
15961594
{
1597-
15981595
if ($Results.Permissions.Count -gt 0)
15991596
{
16001597
$complexMapping = @(

Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ function Set-TargetResource
379379
}
380380
#region resource generator code
381381
Write-Verbose -Message "Parameters:`r`n$(ConvertTo-Json $UpdateParameters -Depth 10)"
382+
$UpdateParameters.Add('@odata.type', '#microsoft.graph.fido2AuthenticationMethodConfiguration')
382383
Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration `
383384
-AuthenticationMethodConfigurationId $currentInstance.Id `
384385
-BodyParameter $UpdateParameters

Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.psm1

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ function Get-TargetResource
101101
$B2BCollaborationInboundValue = @{
102102
Applications = @{
103103
AccessType = $getValue.B2BCollaborationInbound.Applications.AccessType
104-
Targets = [System.String[]] $getValue.B2BCollaborationInbound.Applications.Targets
104+
Targets = [System.Array]$getValue.B2BCollaborationInbound.Applications.Targets
105105
}
106106
UsersAndGroups =@{
107107
AccessType = $getValue.B2BCollaborationInbound.UsersAndGroups.AccessType
108-
Targets = [System.String[]] $getValue.B2BCollaborationInbound.UsersAndGroups.Targets
108+
Targets = [System.Array] $getValue.B2BCollaborationInbound.UsersAndGroups.Targets
109109
}
110110
}
111111
}
@@ -114,11 +114,11 @@ function Get-TargetResource
114114
$B2BCollaborationOutboundValue = @{
115115
Applications = @{
116116
AccessType = $getValue.B2BCollaborationOutbound.Applications.AccessType
117-
Targets = [System.String[]] $getValue.B2BCollaborationOutbound.Applications.Targets
117+
Targets = [System.Array] $getValue.B2BCollaborationOutbound.Applications.Targets
118118
}
119119
UsersAndGroups =@{
120120
AccessType = $getValue.B2BCollaborationOutbound.UsersAndGroups.AccessType
121-
Targets = [System.String[]] $getValue.B2BCollaborationOutbound.UsersAndGroups.Targets
121+
Targets = [System.Array] $getValue.B2BCollaborationOutbound.UsersAndGroups.Targets
122122
}
123123
}
124124
}
@@ -127,11 +127,11 @@ function Get-TargetResource
127127
$B2BDirectConnectInboundValue = @{
128128
Applications = @{
129129
AccessType = $getValue.B2BDirectConnectInbound.Applications.AccessType
130-
Targets = [System.String[]] $getValue.B2BDirectConnectInbound.Applications.Targets
130+
Targets = [System.Array] $getValue.B2BDirectConnectInbound.Applications.Targets
131131
}
132132
UsersAndGroups =@{
133133
AccessType = $getValue.B2BDirectConnectInbound.UsersAndGroups.AccessType
134-
Targets = [System.String[]] $getValue.B2BDirectConnectInbound.UsersAndGroups.Targets
134+
Targets = [System.Array] $getValue.B2BDirectConnectInbound.UsersAndGroups.Targets
135135
}
136136
}
137137
}
@@ -140,11 +140,11 @@ function Get-TargetResource
140140
$B2BDirectConnectOutboundValue = @{
141141
Applications = @{
142142
AccessType = $getValue.B2BDirectConnectOutbound.Applications.AccessType
143-
Targets = [System.String[]] $getValue.B2BDirectConnectOutbound.Applications.Targets
143+
Targets = [System.Array] $getValue.B2BDirectConnectOutbound.Applications.Targets
144144
}
145145
UsersAndGroups =@{
146146
AccessType = $getValue.B2BDirectConnectOutbound.UsersAndGroups.AccessType
147-
Targets = [System.String[]] $getValue.B2BDirectConnectOutbound.UsersAndGroups.Targets
147+
Targets = [System.Array] $getValue.B2BDirectConnectOutbound.UsersAndGroups.Targets
148148
}
149149
}
150150
}
@@ -837,4 +837,3 @@ function Get-M365DSCAADCrossTenantAccessPolicyInboundTrust
837837
}
838838

839839
Export-ModuleMember -Function *-TargetResource
840-

Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function Get-TargetResource
169169
[Array]$query = Get-MgBetaEntitlementManagementAccessPackageIncompatibleWith -AccessPackageId $getValue.id
170170
if ($query.count -gt 0)
171171
{
172-
$getIncompatibleAccessPackages += $query.id
172+
$getAccessPackagesIncompatibleWith += $query.id
173173
}
174174

175175
$getIncompatibleGroups = @()
@@ -954,4 +954,3 @@ function Export-TargetResource
954954
}
955955

956956
Export-ModuleMember -Function *-TargetResource
957-

Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleEligibilityScheduleRequest/MSFT_AADRoleEligibilityScheduleRequest.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ function Test-TargetResource
612612

613613
$result = Test-M365DSCTargetResource -DesiredValues $PSBoundParameters `
614614
-ResourceName $($MyInvocation.MyCommand.Source).Replace('MSFT_', '') `
615-
-ExcludedProperties @('Action', 'IsValidationOnly', 'Justification') -Verbose
615+
-ExcludedProperties @('Action', 'IsValidationOnly', 'Justification')
616616
return $result
617617
}
618618

Modules/Microsoft365DSC/DSCResources/MSFT_AADServicePrincipal/MSFT_AADServicePrincipal.psm1

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,13 @@ function Get-TargetResource
156156
$nullReturn = $PSBoundParameters
157157
$nullReturn.Ensure = 'Absent'
158158

159+
$AADServicePrincipal = $null
159160
try
160161
{
161162
if (-not [System.String]::IsNullOrEmpty($ObjectID))
162163
{
163164
$AADServicePrincipal = Get-MgServicePrincipal -ServicePrincipalId $ObjectId `
164-
-Property $Script:PropertiesToExport
165+
-Property $Script:PropertiesToExport `
165166
-Expand 'AppRoleAssignedTo' `
166167
-ErrorAction Stop
167168
}
@@ -176,12 +177,12 @@ function Get-TargetResource
176177
$ObjectGuid = [System.Guid]::empty
177178
if (-not [System.Guid]::TryParse($AppId, [System.Management.Automation.PSReference]$ObjectGuid))
178179
{
179-
$appInstance = Get-MgApplication -Filter "DisplayName eq '$($AppId -replace "'", "''")'"
180-
if ($appInstance)
181-
{
182-
$AADServicePrincipal = Get-MgServicePrincipal -Filter "AppID eq '$($appInstance.AppId)'" `
180+
$AADServicePrincipal = [Array](Get-MgServicePrincipal -Filter "DisplayName eq '$($AppId -replace "'", "''")'" `
183181
-Property $Script:PropertiesToExport `
184-
-Expand 'AppRoleAssignedTo'
182+
-Expand 'AppRoleAssignedTo')
183+
if ($null -ne $AADServicePrincipal -and $AADServicePrincipal.Count -gt 1)
184+
{
185+
Throw "Multiple Service Principal with the DisplayName $($AppId) exist in the tenant."
185186
}
186187
}
187188
else
@@ -341,12 +342,36 @@ function Get-TargetResource
341342
$appIdToExport = $AADServicePrincipal.AppId
342343
}
343344

345+
$tagsValue = @()
346+
if ($null -ne $AADServicePrincipal.Tags)
347+
{
348+
$tagsValue = [Array]($AADServicePrincipal.Tags)
349+
}
350+
351+
$alternativeNamesValue = @()
352+
if ($null -ne $AADServicePrincipal.AlternativeNames)
353+
{
354+
$alternativeNamesValue = [Array]($AADServicePrincipal.AlternativeNames)
355+
}
356+
357+
$replyUrlsValue = @()
358+
if ($null -ne $AADServicePrincipal.ReplyURLs)
359+
{
360+
$replyUrlsValue = [Array]($AADServicePrincipal.ReplyURLs)
361+
}
362+
363+
$servicePrincipalNamesValue = @()
364+
if ($null -ne $AADServicePrincipal.ServicePrincipalNames)
365+
{
366+
$servicePrincipalNamesValue = [Array]($AADServicePrincipal.ServicePrincipalNames)
367+
}
368+
344369
$result = @{
345370
AppId = $appIdToExport
346371
AppRoleAssignedTo = $AppRoleAssignedToValues
347372
ObjectID = $AADServicePrincipal.Id
348373
DisplayName = $AADServicePrincipal.DisplayName
349-
AlternativeNames = $AADServicePrincipal.AlternativeNames
374+
AlternativeNames = $alternativeNamesValue
350375
AccountEnabled = [boolean]$AADServicePrincipal.AccountEnabled
351376
AppRoleAssignmentRequired = $AADServicePrincipal.AppRoleAssignmentRequired
352377
CustomSecurityAttributes = $complexCustomSecurityAttributes
@@ -358,11 +383,11 @@ function Get-TargetResource
358383
Owners = $ownersValues
359384
PreferredSingleSignOnMode = $AADServicePrincipal.PreferredSingleSignOnMode
360385
PublisherName = $AADServicePrincipal.PublisherName
361-
ReplyURLs = $AADServicePrincipal.ReplyURLs
386+
ReplyURLs = $replyUrlsValue
362387
SamlMetadataURL = $AADServicePrincipal.SamlMetadataURL
363-
ServicePrincipalNames = $AADServicePrincipal.ServicePrincipalNames
388+
ServicePrincipalNames = $servicePrincipalNamesValue
364389
ServicePrincipalType = $AADServicePrincipal.ServicePrincipalType
365-
Tags = $AADServicePrincipal.Tags
390+
Tags = $tagsValue
366391
KeyCredentials = $complexKeyCredentials
367392
PasswordCredentials = $complexPasswordCredentials
368393
Ensure = 'Present'

Modules/Microsoft365DSC/DSCResources/MSFT_AADUser/MSFT_AADUser.psm1

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ function Get-TargetResource
6262
[System.String]
6363
$Office,
6464

65+
[Parameter()]
66+
[System.String]
67+
$Mail,
68+
6569
[Parameter()]
6670
[System.String[]]
6771
$OtherMails,
@@ -169,6 +173,7 @@ function Get-TargetResource
169173
UsageLocation = $null
170174
LicenseAssignment = $null
171175
MemberOf = $null
176+
Mail = $null
172177
OtherMails = $null
173178
Password = $null
174179
Credential = $Credential
@@ -182,7 +187,7 @@ function Get-TargetResource
182187
}
183188

184189
Write-Verbose -Message "Getting Office 365 User $UserPrincipalName"
185-
$propertiesToRetrieve = @('Id', 'UserPrincipalName', 'DisplayName', 'GivenName', 'Surname', 'UsageLocation', 'City', 'Country', 'Department', 'FaxNumber', 'MobilePhone', 'OfficeLocation', 'OtherMails', 'BusinessPhones', 'PostalCode', 'PreferredLanguage', 'State', 'StreetAddress', 'JobTitle', 'UserType', 'PasswordPolicies')
190+
$propertiesToRetrieve = @('Id', 'UserPrincipalName', 'DisplayName', 'GivenName', 'Surname', 'UsageLocation', 'City', 'Country', 'Department', 'FaxNumber', 'MobilePhone', 'OfficeLocation', 'Mail', 'OtherMails', 'BusinessPhones', 'PostalCode', 'PreferredLanguage', 'State', 'StreetAddress', 'JobTitle', 'UserType', 'PasswordPolicies')
186191
$user = Get-MgUser -UserId $UserPrincipalName -Property $propertiesToRetrieve -ErrorAction SilentlyContinue
187192
if ($null -eq $user)
188193
{
@@ -261,6 +266,7 @@ function Get-TargetResource
261266
Fax = $user.FaxNumber
262267
MobilePhone = $user.MobilePhone
263268
Office = $user.OfficeLocation
269+
Mail = $user.Mail
264270
OtherMails = $user.OtherMails
265271
PasswordNeverExpires = $passwordNeverExpires
266272
PasswordPolicies = $user.PasswordPolicies
@@ -355,6 +361,10 @@ function Set-TargetResource
355361
[System.String]
356362
$Office,
357363

364+
[Parameter()]
365+
[System.String]
366+
$Mail,
367+
358368
[Parameter()]
359369
[System.String[]]
360370
$OtherMails,
@@ -479,6 +489,7 @@ function Set-TargetResource
479489
MobilePhone = $MobilePhone
480490
PasswordPolicies = $PasswordPolicies
481491
OfficeLocation = $Office
492+
Mail = $Mail
482493
OtherMails = $OtherMails
483494
PostalCode = $PostalCode
484495
PreferredLanguage = $PreferredLanguage
@@ -793,6 +804,10 @@ function Test-TargetResource
793804
[System.String]
794805
$Office,
795806

807+
[Parameter()]
808+
[System.String]
809+
$Mail,
810+
796811
[Parameter()]
797812
[System.String[]]
798813
$OtherMails,
@@ -942,7 +957,7 @@ function Export-TargetResource
942957
try
943958
{
944959
$Script:ExportMode = $true
945-
$propertiesToRetrieve = @('Id', 'UserPrincipalName', 'DisplayName', 'GivenName', 'Surname', 'UsageLocation', 'City', 'Country', 'Department', 'FacsimileTelephoneNumber', 'Mobile', 'OfficeLocation', 'OtherMails', 'TelephoneNumber', 'PostalCode', 'PreferredLanguage', 'State', 'StreetAddress', 'JobTitle', 'UserType', 'PasswordPolicies')
960+
$propertiesToRetrieve = @('Id', 'UserPrincipalName', 'DisplayName', 'GivenName', 'Surname', 'UsageLocation', 'City', 'Country', 'Department', 'FacsimileTelephoneNumber', 'Mobile', 'OfficeLocation', 'Mail', 'OtherMails', 'TelephoneNumber', 'PostalCode', 'PreferredLanguage', 'State', 'StreetAddress', 'JobTitle', 'UserType', 'PasswordPolicies')
946961
$ExportParameters = @{
947962
Filter = $Filter
948963
All = [switch]$true

Modules/Microsoft365DSC/DSCResources/MSFT_AADUser/MSFT_AADUser.schema.mof

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class MSFT_AADUser : OMI_BaseResource
1616
[Write, Description("The Groups that the user is a direct member of")] String MemberOf[];
1717
[Write, Description("The Mobile Phone Number of the user")] String MobilePhone;
1818
[Write, Description("The Office Name of the user")] String Office;
19+
[Write, Description("The mail address of the user")] String Mail;
1920
[Write, Description("The other mails assigned to the user")] String OtherMails[];
2021
[Write, Description("Specifies whether the user password expires periodically. Default value is false")] Boolean PasswordNeverExpires;
2122
[Write, Description("Specifies password policies for the user.")] String PasswordPolicies;

Modules/Microsoft365DSC/DSCResources/MSFT_EXOFocusedInbox/MSFT_EXOFocusedInbox.psm1

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ function Get-TargetResource
6767
$nullResult.Ensure = 'Absent'
6868
try
6969
{
70-
$instance = Get-FocusedInbox -Identity $Identity -ErrorAction SilentlyContinue
70+
$mailbox = Get-Mailbox -Identity $Identity -ErrorAction SilentlyContinue
71+
if ($null -ne $mailbox)
72+
{
73+
$instance = Get-FocusedInbox -Identity $Identity
74+
}
75+
7176
if ($null -eq $instance)
7277
{
7378
return $nullResult
@@ -76,7 +81,8 @@ function Get-TargetResource
7681
$results = @{
7782
Identity = $Identity
7883
FocusedInboxOn = [Boolean]$instance.FocusedInboxOn
79-
FocusedInboxOnLastUpdateTime = [DateTime]$instance.FocusedInboxOnLastUpdateTime
84+
# DEPRECATED
85+
# FocusedInboxOnLastUpdateTime = [DateTime]$instance.FocusedInboxOnLastUpdateTime
8086
Ensure = 'Present'
8187
Credential = $Credential
8288
ApplicationId = $ApplicationId
@@ -228,6 +234,7 @@ function Test-TargetResource
228234

229235
$CurrentValues = Get-TargetResource @PSBoundParameters
230236
$ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone()
237+
$ValuesToCheck.Remove('FocusedInboxOnLastUpdateTime') | Out-Null
231238

232239
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
233240
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $ValuesToCheck)"
@@ -309,6 +316,11 @@ function Export-TargetResource
309316
}
310317
foreach ($config in $Script:exportedInstances)
311318
{
319+
if ($null -ne $Global:M365DSCExportResourceInstancesCount)
320+
{
321+
$Global:M365DSCExportResourceInstancesCount++
322+
}
323+
312324
$displayedKey = $config.UserPrincipalName
313325
Write-M365DSCHost -Message " |---[$i/$($Script:exportedInstances.Count)] $displayedKey" -DeferWrite
314326
$params = @{

0 commit comments

Comments
 (0)