<?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: Invalid value in DNS parameter: &amp;quot;System.String[]&amp;quot; in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Invalid-value-in-DNS-parameter-quot-System-String-quot/m-p/2968537#M111960</link>
    <description>&lt;P&gt;This is indeed the answer. How can I tell that it's an array when it only outputs 1 item?&lt;/P&gt;</description>
    <pubDate>Mon, 15 May 2023 14:46:41 GMT</pubDate>
    <dc:creator>mk_ultra</dc:creator>
    <dc:date>2023-05-15T14:46:41Z</dc:date>
    <item>
      <title>Invalid value in DNS parameter: "System.String[]"</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Invalid-value-in-DNS-parameter-quot-System-String-quot/m-p/2968496#M111953</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hello, I am trying to dynamically set a host's DNS server to the local domain controller in the cluster. It sounds like this may just be an object type error? It works when I set the $DNSServer variables to a "[ip address]". What is the difference between a String[] and a System.String[] ?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$DomainController&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Get-Cluster&lt;/SPAN&gt; &lt;SPAN&gt;$ClusterName&lt;/SPAN&gt; &lt;SPAN&gt;|&lt;/SPAN&gt; &lt;SPAN&gt;Get-VM&lt;/SPAN&gt; &lt;SPAN&gt;|&lt;/SPAN&gt; &lt;SPAN&gt;Where-Object&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN&gt;$_&lt;/SPAN&gt;&lt;SPAN&gt;.Name&lt;/SPAN&gt; &lt;SPAN&gt;-like&lt;/SPAN&gt; &lt;SPAN&gt;"*999"&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$DomainControllerIP&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;$DomainController&lt;/SPAN&gt;&lt;SPAN&gt;.Guest.IPAddress&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$DNSServer1&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;$DomainControllerIP&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$DNSServer2&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"[redacted]"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$VMHostNetwork&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Get-VMHostNetwork&lt;/SPAN&gt; &lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Host &lt;/SPAN&gt;&lt;SPAN&gt;$IPAddress&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Set-VMHostNetwork&lt;/SPAN&gt; &lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Network &lt;/SPAN&gt;&lt;SPAN&gt;$VMHostNetwork&lt;/SPAN&gt; &lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;DomainName &lt;/SPAN&gt;&lt;SPAN&gt;$SearchDomain&lt;/SPAN&gt; &lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;SearchDomain &lt;/SPAN&gt;&lt;SPAN&gt;$SearchDomain&lt;/SPAN&gt; &lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;HostName &lt;/SPAN&gt;&lt;SPAN&gt;$HostName&lt;/SPAN&gt; &lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;DNSAddress &lt;/SPAN&gt;&lt;SPAN&gt;$DNSServer1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN&gt;$DNSServer2&lt;/SPAN&gt; &lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;DnsFromDhcp:&lt;/SPAN&gt;&lt;SPAN&gt;$false&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Full error:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;Set-VMHostNetwork : 5/15/2023 8:29:43 AM Set-VMHostNetwork &lt;STRONG&gt;Invalid value in DNS parameter: "System.String[]"&lt;/STRONG&gt;&lt;BR /&gt;+ ... Set-VMHostNetwork -Network $VMHostNetwork -DomainName $Se ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidArgument: (:) [Set-VMHostNetwork], InvalidArgument&lt;BR /&gt;+ FullyQualifiedErrorId : Core_SetVmHostNetwork_TryValidateParameterList_InvalidDNSName,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.SetVMHostNetwork&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 15 May 2023 13:33:38 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Invalid-value-in-DNS-parameter-quot-System-String-quot/m-p/2968496#M111953</guid>
      <dc:creator>mk_ultra</dc:creator>
      <dc:date>2023-05-15T13:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value in DNS parameter: "System.String[]"</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Invalid-value-in-DNS-parameter-quot-System-String-quot/m-p/2968519#M111957</link>
      <description>&lt;P&gt;Did you check that&amp;nbsp;&lt;SPAN&gt;$DomainControllerIP is a String and not an array of Strings?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 14:17:57 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Invalid-value-in-DNS-parameter-quot-System-String-quot/m-p/2968519#M111957</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-05-15T14:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value in DNS parameter: "System.String[]"</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Invalid-value-in-DNS-parameter-quot-System-String-quot/m-p/2968537#M111960</link>
      <description>&lt;P&gt;This is indeed the answer. How can I tell that it's an array when it only outputs 1 item?&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 14:46:41 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Invalid-value-in-DNS-parameter-quot-System-String-quot/m-p/2968537#M111960</guid>
      <dc:creator>mk_ultra</dc:creator>
      <dc:date>2023-05-15T14:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value in DNS parameter: "System.String[]"</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Invalid-value-in-DNS-parameter-quot-System-String-quot/m-p/2968538#M111961</link>
      <description>&lt;P&gt;You can use the GetType() method&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;$DomainControllerIP.GetType()&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 15 May 2023 14:52:48 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Invalid-value-in-DNS-parameter-quot-System-String-quot/m-p/2968538#M111961</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-05-15T14:52:48Z</dc:date>
    </item>
  </channel>
</rss>

