Skip to content

Commit

Permalink
Merge pull request #4359 from microsoft/Dev
Browse files Browse the repository at this point in the history
Release 1.24.221.1
  • Loading branch information
NikCharlebois committed Feb 22, 2024
2 parents 5b558a4 + 604b66e commit 522ec2e
Show file tree
Hide file tree
Showing 54 changed files with 532 additions and 273 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,40 @@
# Change log for Microsoft365DSC

# 1.24.221.1

* AADApplication
* Expose the description field in the resource.
* AADConditionalAccessPolicy
* Fixing issue where Membership kinds no longer accepted empty values.
ROLLING BACK [#4344](https://github.com/microsoft/Microsoft365DSC/issues/4344)
FIXES [#4347](https://github.com/microsoft/Microsoft365DSC/issues/4347)
* Throws an error if role, user or group was not found in the Set method.
FIXES [#4342](https://github.com/microsoft/Microsoft365DSC/issues/4342)
* EXOAuthenticationPolicyAssignment
* Improved performance by using a filter to retrieve assignments.
* Export now retrieves the user principal name instead of the user id.
* EXOAvailabilityConfig
* Export now retrieves the user principal name instead of the user id.
* EXOCASMailboxPlan
* Added the DisplayName property.
* EXODataClassification
* Added logic to retrieve by name in the GET method if no match found by id.
* EXOMailboxAutoReplyConfiguration
* Added the owner property.
* EXOMailboxPlan
* Added the DisplayName property.
* EXOMailboxSettings
* Export now retrieves instances by User Principal Name instead of GUID.
* EXOPlace
* Added the DisplayName property.
* EXORecipientPermission
* Export now retrieves instances by User Principal Name instead of GUID.
* EXOSharedMailbox
* Added the Identity parameter.
* MISC
* Uninstall-M365DSCOutdatedDependencies
* Outdated Microsoft365DSC-modules are now removed in their entirety

# 1.24.214.3

* AADAuthenticationMethodPolicy
Expand Down
Expand Up @@ -20,6 +20,10 @@ function Get-TargetResource
[System.Boolean]
$AvailableToOtherTenants,

[Parameter()]
[System.String]
$Description,

[Parameter()]
[System.String]
$GroupMembershipClaims,
Expand Down Expand Up @@ -144,7 +148,7 @@ function Get-TargetResource
}
if ($null -ne $AADApp -and $AADApp.Count -gt 1)
{
Throw "Multiple AAD Apps with the Displayname $($DisplayName) exist in the tenant. These apps will not be exported."
Throw "Multiple AAD Apps with the Displayname $($DisplayName) exist in the tenant."
}
elseif ($null -eq $AADApp)
{
Expand Down Expand Up @@ -189,6 +193,7 @@ function Get-TargetResource
$result = @{
DisplayName = $AADApp.DisplayName
AvailableToOtherTenants = $AvailableToOtherTenantsValue
Description = $AADApp.Description
GroupMembershipClaims = $AADApp.GroupMembershipClaims
Homepage = $AADApp.web.HomepageUrl
IdentifierUris = $AADApp.IdentifierUris
Expand Down Expand Up @@ -253,6 +258,10 @@ function Set-TargetResource
[System.Boolean]
$AvailableToOtherTenants,

[Parameter()]
[System.String]
$Description,

[Parameter()]
[System.String]
$GroupMembershipClaims,
Expand Down Expand Up @@ -682,6 +691,10 @@ function Test-TargetResource
[System.Boolean]
$AvailableToOtherTenants,

[Parameter()]
[System.String]
$Description,

[Parameter()]
[System.String]
$GroupMembershipClaims,
Expand Down Expand Up @@ -884,6 +897,7 @@ function Export-TargetResource
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
ApplicationSecret = $ApplicationSecret
Description = $AADApp.Description
DisplayName = $AADApp.DisplayName
ObjectID = $AADApp.Id
Credential = $Credential
Expand Down Expand Up @@ -926,6 +940,7 @@ function Export-TargetResource
Write-Host "`r`n $($Global:M365DSCEmojiYellowCircle)" -NoNewline
Write-Host " Multiple app instances wth name {$($AADApp.DisplayName)} were found. We will skip exporting these instances."
}
$i++
}
}
return $dscContent.ToString()
Expand Down
Expand Up @@ -14,6 +14,7 @@ class MSFT_AADApplication : OMI_BaseResource
[Write, Description("ObjectID of the app.")] String ObjectId;
[Write, Description("AppId for the app.")] String AppId;
[Write, Description("Indicates whether this application is available in other tenants.")] Boolean AvailableToOtherTenants;
[Write, Description("A free text field to provide a description of the application object to end users. The maximum allowed size is 1024 characters.")] String Description;
[Write, Description("A bitmask that configures the groups claim issued in a user or OAuth 2.0 access token that the application expects.")] String GroupMembershipClaims;
[Write, Description("The URL to the application's homepage.")] String Homepage;
[Write, Description("User-defined URI(s) that uniquely identify a Web application within its Azure AD tenant, or within a verified custom domain.")] string IdentifierUris[];
Expand Down
Expand Up @@ -71,7 +71,7 @@ function Get-TargetResource

[Parameter()]
[System.String]
[ValidateSet('all', 'enumerated', 'unknownFutureValue')]
[ValidateSet('', 'all', 'enumerated', 'unknownFutureValue')]
$IncludeExternalTenantsMembershipKind,

[Parameter()]
Expand All @@ -85,7 +85,7 @@ function Get-TargetResource

[Parameter()]
[System.String]
[ValidateSet('all', 'enumerated', 'unknownFutureValue')]
[ValidateSet('', 'all', 'enumerated', 'unknownFutureValue')]
$ExcludeExternalTenantsMembershipKind,

[Parameter()]
Expand Down Expand Up @@ -755,7 +755,7 @@ function Set-TargetResource

[Parameter()]
[System.String]
[ValidateSet('all', 'enumerated', 'unknownFutureValue')]
[ValidateSet('', 'all', 'enumerated', 'unknownFutureValue')]
$IncludeExternalTenantsMembershipKind,

[Parameter()]
Expand All @@ -769,7 +769,7 @@ function Set-TargetResource

[Parameter()]
[System.String]
[ValidateSet('all', 'enumerated', 'unknownFutureValue')]
[ValidateSet('', 'all', 'enumerated', 'unknownFutureValue')]
$ExcludeExternalTenantsMembershipKind,

[Parameter()]
Expand Down Expand Up @@ -1014,6 +1014,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $_
}
if ($null -eq $userguid)
{
Expand All @@ -1022,6 +1023,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $message
}
else
{
Expand Down Expand Up @@ -1059,6 +1061,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $_
}
if ($null -eq $userguid)
{
Expand All @@ -1067,6 +1070,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $message
}
else
{
Expand Down Expand Up @@ -1102,6 +1106,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $_
}
if ($GroupLookup.Length -gt 1)
{
Expand All @@ -1110,6 +1115,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $message
}
elseif ($null -eq $GroupLookup)
{
Expand All @@ -1118,6 +1124,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $message
}
else
{
Expand Down Expand Up @@ -1149,6 +1156,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $_
}
if ($GroupLookup.Length -gt 1)
{
Expand All @@ -1157,6 +1165,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $message
}
elseif ($null -eq $GroupLookup)
{
Expand All @@ -1165,6 +1174,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $message
}
else
{
Expand Down Expand Up @@ -1198,6 +1208,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $message
}
else
{
Expand Down Expand Up @@ -1231,6 +1242,7 @@ function Set-TargetResource
-Source $($MyInvocation.MyCommand.Source) `
-TenantId $TenantId `
-Credential $Credential
throw $message
}
else
{
Expand Down Expand Up @@ -1738,7 +1750,7 @@ function Test-TargetResource

[Parameter()]
[System.String]
[ValidateSet('all', 'enumerated', 'unknownFutureValue')]
[ValidateSet('', 'all', 'enumerated', 'unknownFutureValue')]
$IncludeExternalTenantsMembershipKind,

[Parameter()]
Expand All @@ -1752,7 +1764,7 @@ function Test-TargetResource

[Parameter()]
[System.String]
[ValidateSet('all', 'enumerated', 'unknownFutureValue')]
[ValidateSet('', 'all', 'enumerated', 'unknownFutureValue')]
$ExcludeExternalTenantsMembershipKind,

[Parameter()]
Expand Down
Expand Up @@ -16,10 +16,10 @@ class MSFT_AADConditionalAccessPolicy : OMI_BaseResource
[Write, Description("AAD Admin Roles in scope of the Policy.")] String IncludeRoles[];
[Write, Description("AAD Admin Roles out of scope of the Policy.")] String ExcludeRoles[];
[Write, Description("Represents the Included internal guests or external user types. This is a multi-valued property. Supported values are: b2bCollaborationGuest, b2bCollaborationMember, b2bDirectConnectUser, internalGuest, OtherExternalUser, serviceProvider and unknownFutureValue."), ValueMap{"none","internalGuest","b2bCollaborationGuest","b2bCollaborationMember","b2bDirectConnectUser","otherExternalUser","serviceProvider","unknownFutureValue"}, Values{"none","internalGuest","b2bCollaborationGuest","b2bCollaborationMember","b2bDirectConnectUser","otherExternalUser","serviceProvider","unknownFutureValue"}] String IncludeGuestOrExternalUserTypes[];
[Write, Description("Represents the Included Tenants membership kind. The possible values are: all, enumerated, unknownFutureValue. enumerated references an object of conditionalAccessEnumeratedExternalTenants derived type."), ValueMap{"all","enumerated","unknownFutureValue"}, Values{"all","enumerated","unknownFutureValue"}] String IncludeExternalTenantsMembershipKind;
[Write, Description("Represents the Included Tenants membership kind. The possible values are: all, enumerated, unknownFutureValue. enumerated references an object of conditionalAccessEnumeratedExternalTenants derived type."), ValueMap{"","all","enumerated","unknownFutureValue"}, Values{"","all","enumerated","unknownFutureValue"}] String IncludeExternalTenantsMembershipKind;
[Write, Description("Represents the Included collection of tenant ids in the scope of Conditional Access for guests and external users policy targeting.")] String IncludeExternalTenantsMembers[];
[Write, Description("Represents the Excluded internal guests or external user types. This is a multi-valued property. Supported values are: b2bCollaborationGuest, b2bCollaborationMember, b2bDirectConnectUser, internalGuest, OtherExternalUser, serviceProvider and unknownFutureValue."), ValueMap{"none","internalGuest","b2bCollaborationGuest","b2bCollaborationMember","b2bDirectConnectUser","otherExternalUser","serviceProvider","unknownFutureValue"}, Values{"none","internalGuest","b2bCollaborationGuest","b2bCollaborationMember","b2bDirectConnectUser","otherExternalUser","serviceProvider","unknownFutureValue"}] String ExcludeGuestOrExternalUserTypes[];
[Write, Description("Represents the Excluded Tenants membership kind. The possible values are: all, enumerated, unknownFutureValue. enumerated references an object of conditionalAccessEnumeratedExternalTenants derived type."), ValueMap{"all","enumerated","unknownFutureValue"}, Values{"all","enumerated","unknownFutureValue"}] String ExcludeExternalTenantsMembershipKind;
[Write, Description("Represents the Excluded Tenants membership kind. The possible values are: all, enumerated, unknownFutureValue. enumerated references an object of conditionalAccessEnumeratedExternalTenants derived type."), ValueMap{"","all","enumerated","unknownFutureValue"}, Values{"","all","enumerated","unknownFutureValue"}] String ExcludeExternalTenantsMembershipKind;
[Write, Description("Represents the Excluded collection of tenant ids in the scope of Conditional Access for guests and external users policy targeting.")] String ExcludeExternalTenantsMembers[];
[Write, Description("Client Device Platforms in scope of the Policy.")] String IncludePlatforms[];
[Write, Description("Client Device Platforms out of scope of the Policy.")] String ExcludePlatforms[];
Expand Down
Expand Up @@ -2,6 +2,7 @@
class MSFT_EXOActiveSyncDeviceAccessRule : OMI_BaseResource
{
[Key, Description("The Identity parameter specifies the identity of the device access rule.")] String Identity;
[Write, Description("Unique Identifier. Read-Only")] String GUID;
[Write, Description("The AccessLevel parameter specifies whether the devices are allowed, blocked or quarantined."), ValueMap{"Allow","Block","Quarantine"}, Values{"Allow","Block","Quarantine"}] String AccessLevel;
[Write, Description("The Characteristic parameter specifies the device characteristic or category that's used by the rule."), ValueMap{"DeviceModel","DeviceType","DeviceOS","UserAgent","XMSWLHeader"}, Values{"DeviceModel","DeviceType","DeviceOS","UserAgent","XMSWLHeader"}] String Characteristic;
[Write, Description("The QueryString parameter specifies the device identifier that's used by the rule. This parameter uses a text value that's used with Characteristic parameter value to define the device.")] String QueryString;
Expand Down
Expand Up @@ -346,20 +346,15 @@ function Export-TargetResource
Write-Host "`r`n" -NoNewline
}
$i = 1
$allUsers = $null
foreach ($AuthenticationPolicy in $AllAuthenticationPolicies)
{
Write-Host " |---[$i/$($AllAuthenticationPolicies.Count)] $($AuthenticationPolicy.Identity)" -NoNewline
if (-not $allUsers)
{
$allUsers = Get-User -ResultSize 'Unlimited'
}
$assignedUsers = $allUsers | Where-Object -FilterScript { $_.AuthenticationPolicy -eq $AuthenticationPolicy.Identity }
$assignedUsers = Get-User -Filter "AuthenticationPolicy -eq '$($AuthenticationPolicy.DistinguishedName)'"

foreach ($user in $assignedUsers)
{
$Params = @{
UserName = $user.Name
UserName = $user.UserPrincipalName
Credential = $Credential
ApplicationId = $ApplicationId
TenantId = $TenantId
Expand Down
Expand Up @@ -99,7 +99,10 @@ function Get-TargetResource
{
try
{
$AvailabilityAddressSpace = Get-AvailabilityAddressSpace -Identity $ForestName -ErrorAction Stop
if (-not [System.String]::IsNullOrEmpty($ForestName))
{
$AvailabilityAddressSpace = Get-AvailabilityAddressSpace -Identity $ForestName -ErrorAction Stop
}
}
catch
{
Expand Down
Expand Up @@ -346,7 +346,8 @@ function Export-TargetResource
$OrgWideValue = "NotConfigured"
if ($null -ne $AvailabilityConfig.OrgWideAccount)
{
$OrgWideValue = $AvailabilityConfig.OrgWideAccount.ToString()
$user = Get-User -Identity $AvailabilityConfig.OrgWideAccount.ToString()
$OrgWideValue = $user.UserPrincipalName
}
$Params = @{
OrgWideAccount = $OrgWideValue
Expand Down

0 comments on commit 522ec2e

Please sign in to comment.