Created
August 26, 2022 04:24
-
-
Save Nillth/0fbe31abc82ab93b44af81057f9a9371 to your computer and use it in GitHub Desktop.
Cleans up a SAML IDP Metadata file to remove the RoleDescriptor nodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.NOTES | |
=========================================================================== | |
Created on: 2022-08-26 2:21 PM | |
Created by: Marc Collins | |
Organization: Qlik Customer Success | |
Filename: SAML_Remove_RoleDescriptors.ps1 | |
=========================================================================== | |
.DESCRIPTION | |
Removes the RoleDescriptor nodes from a XML file and resaves | |
Resolved https://support.qlik.com/articles/000052086 | |
#> | |
$NewMetaDataFile = "\\path\to\IDPMetadata.xml" | |
$IDPXML = New-Object xml | |
$IDPXML.Load($NewMetaDataFile) | |
$IDPNS = New-Object Xml.XmlNamespaceManager $IDPXML.NameTable | |
$IDPNS.AddNamespace('idp', $IDPXML.EntityDescriptor.xmlns) | |
$RD = $IDPXML.SelectNodes("//idp:RoleDescriptor", $IDPNS) | |
$RD | ForEach-Object{ | |
$_.ParentNode.RemoveChild($_) | |
} | |
$IDPXML.Save($NewMetaDataFile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment