0

I'm attempting to create a script that will use "Set-ADFSRelyingPartyTrust -TargetName X -Identifier []" to add an additional Identifier to the ones that already exist. Since running the command as is only replaces the existing Identifiers, I need to find a way to create a variable from the existing Identifiers and then add the new Identifier on top of that.

One thing I tried is running this:

$ID = Get-ADFSRelyingPartyTrust -Name "X" | select-object identifier
Set-ADFSRelyingPartyTrust -TargetName "X" -Identifier $ID,NewID

But when I use this variable when adding Identifiers, it gets added as @{Identifier=System.Collections.ObjectModel.ReadOnlyCollection`1[System.String]},NewID

If I run this instead:

$ID = Get-ADFSRelyingPartyTrust -Name "X" | Select @(Name=Identifier";Expression={(_.identifier)}}

Then, when I use this variable when adding Identifiers, it gets added as "@{identifier=System.Object[]}" if there were multiple Identifiers configured, or "{@{identifier=[IdentifierName]} if there was only one identifier configured.

Let's say I currently have Identifiers of EntityID1, EntityID2. How do I write this so that those are the output of this variable?

J. Scott
  • 11
  • 2

0 Answers0