Skip to content

Commit

Permalink
Merge pull request #5499 from NikCharlebois/Dev
Browse files Browse the repository at this point in the history
AADActivityBasedTimeout - added support for AccessTokens
  • Loading branch information
NikCharlebois authored Dec 3, 2024
2 parents 4494e1f + 842e806 commit 7eedad7
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
11 changes: 7 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
reading and troubleshooting.
* AADAccessReviewDefinition
* Added support for #microsoft.graph.accessReviewInactiveUsersQueryScope in odatatype.
* AADActivityBasedTimeoutPolicy
* Added support for AccessTokens.
* AADRoleManagementPolicyRule
* Added the logic to handle filters in the Export logic flow.
* EXOManagementRoleAssignment
Expand All @@ -20,12 +22,13 @@
* Initial release
* IntuneVPNConfigurationPolicyIOS
* Initial release.
* M365DSCRuleEvaluation
* Only attempt to pass AccessTokens if specified.
* SPORetentionLabelsSettings
* Initial release.
* M365DSCDRGUtil
* Add separate check for strings with ordinal comparison and standardized line breaks.
* M365DSCUtil
* Add separate check for strings with ordinal comparison and standardized line breaks.
* MISC
* M365DSCDRGUtil
* Add separate check for strings with ordinal comparison and standardized line breaks.

# 1.24.1127.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ function Get-TargetResource

[Parameter()]
[Switch]
$ManagedIdentity
$ManagedIdentity,

[Parameter()]
[System.String[]]
$AccessTokens
)

try
Expand Down Expand Up @@ -104,6 +108,7 @@ function Get-TargetResource
ApplicationSecret = $ApplicationSecret
CertificateThumbprint = $CertificateThumbprint
Managedidentity = $ManagedIdentity.IsPresent
AccessTokens = $AccessTokens
#endregion
}

Expand Down Expand Up @@ -171,7 +176,11 @@ function Set-TargetResource

[Parameter()]
[Switch]
$ManagedIdentity
$ManagedIdentity,

[Parameter()]
[System.String[]]
$AccessTokens
)

#Ensure the proper dependencies are installed in the current environment.
Expand Down Expand Up @@ -353,7 +362,11 @@ function Test-TargetResource

[Parameter()]
[Switch]
$ManagedIdentity
$ManagedIdentity,

[Parameter()]
[System.String[]]
$AccessTokens
)

#Ensure the proper dependencies are installed in the current environment.
Expand Down Expand Up @@ -453,7 +466,11 @@ function Export-TargetResource

[Parameter()]
[Switch]
$ManagedIdentity
$ManagedIdentity,

[Parameter()]
[System.String[]]
$AccessTokens
)

$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
Expand Down Expand Up @@ -511,6 +528,7 @@ function Export-TargetResource
ApplicationSecret = $ApplicationSecret
CertificateThumbprint = $CertificateThumbprint
Managedidentity = $ManagedIdentity.IsPresent
AccessTokens = $AccessTokens
}

$Results = Get-TargetResource @Params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ class MSFT_AADActivityBasedTimeoutPolicy : OMI_BaseResource
[Write, Description("Secret of the Azure Active Directory tenant used for authentication."), EmbeddedInstance("MSFT_Credential")] String ApplicationSecret;
[Write, Description("Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.")] String CertificateThumbprint;
[Write, Description("Managed ID being used for authentication.")] Boolean ManagedIdentity;
[Write, Description("Access token used for authentication.")] String AccessTokens[];
};
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,16 @@ function Test-TargetResource
TenantId = $PSBoundParameters.TenantId
CertificateThumbprint = $PSBoundParameters.CertificateThumbprint
ManagedIdentity = $PSBoundParameters.ManagedIdentity
AccessTokens = $AccessTokens
}

if ($null -ne $PSBoundParameters.ApplicationSecret)
{
$params.Add('ApplicationSecret', $PSBoundParameters.ApplicationSecret)
}
if ($null -ne $PSBoundParameters.AccessTokens)
{
$params.Add('AccessTokens', $PSBoundParameters.AccessTokens)
}

Write-Verbose -Message "Importing module from Path {$($module)}"
Import-Module $module -Force -Function 'Export-TargetResource' | Out-Null
Expand Down

0 comments on commit 7eedad7

Please sign in to comment.