dsccommunity / dsccommunity/SharePointDsc
SPRemoteFarmTrust issues with Get-TargetResource
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 246
- Forks
- 106
- PR merge metrics
- No merged PRs in 30d
Description
Details of the scenario you try and problem that is occurring:
To replicate the issue:
1 - Use the DSC block below and create a Remote Trust;
2 - Call the get-targetResource function for that resource as follow:
Import-Module "C:\Program Files\WindowsPowerShell\Modules\SharepointDSC\1.7.0.0\DSCResources\MSFT_SPRemoteFarmTrust\MSFT_SPRemoteFarmTrust.psm1" -Force
Get-TargetResource -Name "dfe0e2b5-7eb5-4ce2-b192-b5bcbf0bc600" -LocalWebAppUrl "http://ey-standalone:12877" -RemoteWebAppUrl "http://ey-standalone:12877"
That returns a Hash Table with Ensure = Absent, so we have a problem since it got create properly with the DSC block below. The issue comes from following:
In the Get-targetResource, when we call Get-SPTrustedSecurityTokenIssuer, we call it passing in the Name parameter, where really we should be using an ID parameter, since:
Get-SPTrustedSecurityTokenIssuer -Identity "CentralSearchFarm"
Gives an error. Then later on, we call Get-SPTrustedRootAuthority. This time that cmdlet should be taking on the name and not the id.
The DSC configuration that is using the resource:
SPRemoteFarmTrust TrustRemoteFarmForSearch
{
Name = "CentralSearchFarm"
RemoteWebAppUrl = "https://my-dev2013.eydev.net/"
LocalWebAppUrl = "https://my-dev2013.eydev.net/"
PsDscRunAsCredential = $Credsdw_spfarm;
}
Version of the Operating System and PowerShell the DSC Target Node is running:
Win 2k12 R2 / WMF 5.1
Version of the DSC module you're using:
1.7.0.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in DSCResources/MSFT_SPRemoteFarmTrust/MSFT_SPRemoteFarmTrust.psm1 and inspect Get-TargetResource. Reproduce the call with Get-SPTrustedSecurityTokenIssuer and Get-SPTrustedRootAuthority using the issue's parameters, then verify that an existing remote farm trust is returned with the correct Ensure value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100