<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Setting SAML Authenticator in Connection Server in Horizon Desktops and Apps</title>
    <link>https://communities.vmware.com/t5/Horizon-Desktops-and-Apps/Setting-SAML-Authenticator-in-Connection-Server/m-p/2890547#M96133</link>
    <description>&lt;P&gt;The expected type is ArrayOfSAMLAuthenticatorId, while you try using String.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$saml_auth_id= New-Object VMware.Hv.SAMLAuthenticatorId
$saml_auth_id.Id = 'SamlAuthenticator/XXXXXXX'
[VMware.Hv.SAMLAuthenticatorId[]]$update2.Value = $saml_auth_id&lt;/LI-CODE&gt;&lt;P&gt;This way you get array of one object of type&amp;nbsp;SAMLAuthenticatorId&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 15:58:28 GMT</pubDate>
    <dc:creator>briuzgin</dc:creator>
    <dc:date>2022-01-27T15:58:28Z</dc:date>
    <item>
      <title>Setting SAML Authenticator in Connection Server</title>
      <link>https://communities.vmware.com/t5/Horizon-Desktops-and-Apps/Setting-SAML-Authenticator-in-Connection-Server/m-p/2813008#M92367</link>
      <description>&lt;P&gt;&lt;BR /&gt;I'm attempting to add a newly created SAML Authenticator to a Connection Server using a Powershell script, a snippet of which is below.&lt;/P&gt;&lt;P&gt;If I try and set either the "samlAuthenticator" single value or the "samlAuthenticators" list (with a single value), I get an error "Invalid argument type for this member". I'm using a SAMLAuthenticatorId value, which is the value as returned from when the SAML Authenticator is created.&lt;/P&gt;&lt;P&gt;I don't know if I need to manipulate the id value or use as is, or also if I somehow need to "cast" the value set in the MapEntry.value.&lt;/P&gt;&lt;P&gt;A secondary question here is how I represent an array of values when I'm attempting to set samlAuthenticators, if I just wrap the values in curly brackets, and comma separate the values within it - I cannot find any examples of using an array of things in a MapEntry.value.&lt;/P&gt;&lt;P&gt;Any ideas of what I am doing wrong, or does anyone have examples of working code in this area ? I'm using version 7.8 of Horizon View.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$hvServer = Connect-HVServer -Server hv-connection.example.com -User domainadminuser@example.com -Password "password" -Domain example.com&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$Global:hvServices = $hvServer.ExtensionData&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$csService = New-Object VMware.Hv.ConnectionServerService&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$csList = $csService.ConnectionServer_List($hvServices)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$csId = $csList[0].id&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$update1 = New-Object VMware.Hv.MapEntry&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$update1.key = 'authentication.samlConfig.samlSupport'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$update1.value = 'ENABLED'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;*** or ***&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$update1.value = 'MULTI_ENABLED'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$update2 = New-Object VMware.Hv.MapEntry&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$update2.key = 'authentication.samlConfig.samlAuthenticator'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$update2.value = 'SAMLAuthenticator/ODxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxY0/MzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxVl'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;*** or ***&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$update2 = New-Object VMware.Hv.MapEntry&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$update2.key = 'authentication.samlConfig.samlAuthenticators'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$update2.value = '{SAMLAuthenticator/ODxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxY0/MzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxVl}'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$updates = @()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$updates += $update1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$updates += $update2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$hvServices.ConnectionServer.ConnectionServer_Update($csId, $updates)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Errors :&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Exception calling "ConnectionServer_Update" with "2" argument(s): "ExceptionType : VMware.Hv.InvalidType&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ErrorMessage : Invalid argument type for this member.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ParameterName : authentication.samlConfig.samlAuthenticator&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ExpectedType : SAMLAuthenticatorId"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;At C:\Users\xxx\samlupdate2.ps1:65 char:1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;+ $hvServices.ConnectionServer.ConnectionServer_Update($csId, $updates)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;+ FullyQualifiedErrorId : VimException&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Exception calling "ConnectionServer_Update" with "2" argument(s): "ExceptionType : VMware.Hv.InvalidType&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ErrorMessage : Invalid argument type for this member.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ParameterName : authentication.samlConfig.samlAuthenticators&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ExpectedType : ArrayOfSAMLAuthenticatorId"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;At C:\Users\xxx\samlupdate2.ps1:65 char:1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;+ $hvServices.ConnectionServer.ConnectionServer_Update($csId, $updates)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;+ FullyQualifiedErrorId : VimException&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 02:44:56 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/Horizon-Desktops-and-Apps/Setting-SAML-Authenticator-in-Connection-Server/m-p/2813008#M92367</guid>
      <dc:creator>nvpapworth</dc:creator>
      <dc:date>2020-11-27T02:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Setting SAML Authenticator in Connection Server</title>
      <link>https://communities.vmware.com/t5/Horizon-Desktops-and-Apps/Setting-SAML-Authenticator-in-Connection-Server/m-p/2813033#M92368</link>
      <description>&lt;P&gt;&lt;a href="https://communities.vmware.com/t5/user/viewprofilepage/user-id/5456103"&gt;@nvpapworth&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moderator: Moved to &lt;STRONG&gt;Horizon Desktops and Apps&lt;/STRONG&gt; - more likely to get the right visibility and help here.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 07:23:10 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/Horizon-Desktops-and-Apps/Setting-SAML-Authenticator-in-Connection-Server/m-p/2813033#M92368</guid>
      <dc:creator>scott28tt</dc:creator>
      <dc:date>2020-11-27T07:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Setting SAML Authenticator in Connection Server</title>
      <link>https://communities.vmware.com/t5/Horizon-Desktops-and-Apps/Setting-SAML-Authenticator-in-Connection-Server/m-p/2890547#M96133</link>
      <description>&lt;P&gt;The expected type is ArrayOfSAMLAuthenticatorId, while you try using String.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$saml_auth_id= New-Object VMware.Hv.SAMLAuthenticatorId
$saml_auth_id.Id = 'SamlAuthenticator/XXXXXXX'
[VMware.Hv.SAMLAuthenticatorId[]]$update2.Value = $saml_auth_id&lt;/LI-CODE&gt;&lt;P&gt;This way you get array of one object of type&amp;nbsp;SAMLAuthenticatorId&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 15:58:28 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/Horizon-Desktops-and-Apps/Setting-SAML-Authenticator-in-Connection-Server/m-p/2890547#M96133</guid>
      <dc:creator>briuzgin</dc:creator>
      <dc:date>2022-01-27T15:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Setting SAML Authenticator in Connection Server</title>
      <link>https://communities.vmware.com/t5/Horizon-Desktops-and-Apps/Setting-SAML-Authenticator-in-Connection-Server/m-p/2891165#M96162</link>
      <description>&lt;P&gt;Looks like here is a bug in this object: expecting&amp;nbsp;ArrayOfSAMLAuthenticatorId which doesn't actually exist and should be just and array of&amp;nbsp;SAMLAuthenticatorId.&lt;/P&gt;&lt;P&gt;A workaround is to create an object&amp;nbsp;VMware.Hv.ConnectionServerSAMLData where you can just set this array&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[VMware.Hv.SAMLAuthenticatorId[]]$saml_auth_array = $saml_auth_id
$saml_data = New-Object VMware.Hv.ConnectionServerSAMLData
$saml_data.SamlAuthenticators = $saml_auth_array&lt;/LI-CODE&gt;&lt;P&gt;Then update the same way&amp;nbsp;SamlSupport and SamlAuthenticator in the new object. Just take values from&amp;nbsp;$csList[0] if you don't need to update them.&lt;/P&gt;&lt;P&gt;After that update the entire&amp;nbsp;authentication.samlConfig key with $saml_data.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 17:39:41 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/Horizon-Desktops-and-Apps/Setting-SAML-Authenticator-in-Connection-Server/m-p/2891165#M96162</guid>
      <dc:creator>briuzgin</dc:creator>
      <dc:date>2022-01-31T17:39:41Z</dc:date>
    </item>
  </channel>
</rss>

