dsccommunity / dsccommunity/SharePointDsc

SPRemoteFarmTrust issues with Get-TargetResource

Open
#619 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs investigation
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.