diff --git a/CHANGELOG.md b/CHANGELOG.md index 065878a6a..d249d0ae0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- SPTrustedIdentityTokenIssuer + - Run Get-SPClaimProvider only if property ClaimProviderName is omitted/null/empty. + ### Fixed - SharePointDsc diff --git a/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/MSFT_SPTrustedIdentityTokenIssuer.psm1 b/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/MSFT_SPTrustedIdentityTokenIssuer.psm1 index 5e51bc14b..8d652b122 100644 --- a/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/MSFT_SPTrustedIdentityTokenIssuer.psm1 +++ b/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/MSFT_SPTrustedIdentityTokenIssuer.psm1 @@ -294,12 +294,15 @@ function Set-TargetResource throw "SharePoint failed to create the SPTrustedIdentityTokenIssuer." } - $claimProvider = (Get-SPClaimProvider | Where-Object -FilterScript { - $_.DisplayName -eq $params.ClaimProviderName - }) - if ($null -eq $claimProvider) + if ($false -eq [String]::IsNullOrWhiteSpace($params.ClaimProviderName)) { - $trust.ClaimProviderName = $params.ClaimProviderName + $claimProvider = (Get-SPClaimProvider | Where-Object -FilterScript { + $_.DisplayName -eq $params.ClaimProviderName + }) + if ($null -eq $claimProvider) + { + $trust.ClaimProviderName = $params.ClaimProviderName + } } if ($params.ProviderSignOutUri)