Script per esportare, esportare ed importare o importare soltanto le claim AD FS.
Add-PSSnapin "Microsoft.ADFS.PowerShell" -ErrorAction SilentlyContinue $select = Write-Host "Select operation: (1)Export; (2) Export and Import; (3) Import " $XMLFilePath = "RPTClaim.xml" function show-menu { cls Write-Host "==========Export Import AD FS Claim==========" Write-Host "Press '1' for Export" Write-Host "Press '2' for Export and Import" Write-Host "Press '3' for Import" } function export { $SourceRelyingPartyTrust = Read-Host "Source Relying Party Trust" #Display Name of Source Relying Party Trust Get-ADFSRelyingPartyTrust -Name $SourceRelyingPartyTrust | Export-Clixml $XMLFilePath Write-Host "Relying Party Trust Claim Rules Exported" } function import{ $TargetRelyingPartyTrust = Read-Host "Target Relying Party Trust" #Display Name of Target Relying Party Trust Import-Clixml $XMLFilePath | foreach-object {Set-ADFSRelyingPartyTrust -TargetName $TargetRelyingPartyTrust -IssuanceTransformRules $_.IssuanceTransformRules} Write-Host "Relying Party Trust Claim Rules Imported" } function export-import { export import } show-menu $input = Read-Host "Please make a selection " switch ($input) { '1' { cls export } '2' { cls export-import } '3' { cls import } }
Disclaimer: nessuna garanzia è fornita con questo script. Lo scrivente non è responsabile di qualunque danno possa eventualmente derivarne – lo utilizzate a vostro rischio.