<?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: Disconnect Serial Port in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519026#M48765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your answer!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I run this method I got the following error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method invocation failed because [http://System.Object[|http://System.Object[]] doesn't contain a method named 'ReconfigVM_Task'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Thank you!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Dec 2008 14:38:22 GMT</pubDate>
    <dc:creator>VCPGuru</dc:creator>
    <dc:date>2008-12-01T14:38:22Z</dc:date>
    <item>
      <title>Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519024#M48763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Folks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Disconnect CD-ROM and Floppy disks with the powershell is really easy, but I want to disconnect the Serial Ports in my VM.&lt;/P&gt;&lt;P&gt;Has anyone a script to do that (Or could anybody create a script)???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont wont to remove the serial port, because you can only remove the serial port if the VM is "powered off".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 13:14:17 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519024#M48763</guid>
      <dc:creator>VCPGuru</dc:creator>
      <dc:date>2008-12-01T13:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519025#M48764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to use the &lt;A href="http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.VirtualMachine.html#reconfigure"&gt;ReconfigVM_Task&lt;/A&gt; method from the SDK for that.&lt;/P&gt;&lt;PRE __jive_macro_name="noformat"&gt;
$VMname = &amp;lt;VMname&amp;gt;
$vmImpl = Get-VM $VMname
$vm = $vmImpl | Get-View

$spec = new-object VMware.Vim.VirtualMachineConfigSpec

foreach($dev in $vm.Config.Hardware.Device){
  if($dev.DeviceInfo.Label -like "Serial Port*"){
	$temp = New-Object VMware.Vim.VirtualDeviceConfigSpec
	$temp.device = [http://VMware.Vim.VirtualDevice|http://VMware.Vim.VirtualDevice]$dev
	$temp.device.connectable.connected = $false
	$temp.device.connectable.StartConnected = $false
	$temp.operation = "edit"
	$spec.deviceChange += $temp
  }
}
$vm.ReconfigVM_Task($spec)
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This changes &lt;U&gt;all&lt;/U&gt; serial ports to "disconnected" and will also unselect "Connect at power on".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 14:05:12 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519025#M48764</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2008-12-01T14:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519026#M48765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your answer!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I run this method I got the following error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method invocation failed because [http://System.Object[|http://System.Object[]] doesn't contain a method named 'ReconfigVM_Task'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Thank you!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 14:38:22 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519026#M48765</guid>
      <dc:creator>VCPGuru</dc:creator>
      <dc:date>2008-12-01T14:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519027#M48766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The forum SW has problems with square brackets.&lt;/P&gt;&lt;P&gt;Try the attached script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 14:42:26 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519027#M48766</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2008-12-01T14:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519028#M48767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the attached script I only modified the first line of your script "$VMname = Get-VM"&lt;/P&gt;&lt;P&gt;What are the preconditions that I can use the "ReconfigVM_Task"? Have I to do something or should that script run on each VI3 with VC?&lt;/P&gt;&lt;P&gt;The error i got told me, that the method "ReconfigVM_Task" is unkown?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 14:55:04 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519028#M48767</guid>
      <dc:creator>VCPGuru</dc:creator>
      <dc:date>2008-12-01T14:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519029#M48768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The variable $VMname should be initialised with a string containing the name of a guest.&lt;/P&gt;&lt;P&gt;This is the name as the guest appears in the VI client.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;PRE __jive_macro_name="noformat"&gt;
$VMname = "PC999"
&lt;/PRE&gt;&lt;P&gt;And you did add a &lt;STRONG&gt;Connect-VIServer&lt;/STRONG&gt; to the beginning of the script I suspect ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 14:59:08 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519029#M48768</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2008-12-01T14:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519030#M48769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I disconnect ALL VMs from the serial port?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont want to enter the VMs name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 15:15:58 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519030#M48769</guid>
      <dc:creator>VCPGuru</dc:creator>
      <dc:date>2008-12-01T15:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519031#M48770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By placing a loop around the previous code.&lt;/P&gt;&lt;P&gt;Something like this&lt;/P&gt;&lt;PRE __jive_macro_name="noformat"&gt;

Get-VM | Get-View | %{
  $spec = new-object VMware.Vim.VirtualMachineConfigSpec
  foreach($dev in $_.Config.Hardware.Device){
    if($dev.DeviceInfo.Label -like "Serial Port*"){
	  $temp = New-Object VMware.Vim.VirtualDeviceConfigSpec
	  $temp.device = [http://VMware.Vim.VirtualDevice|http://VMware.Vim.VirtualDevice]$dev
	  $temp.device.connectable.connected = $false
	  $temp.device.connectable.StartConnected = $false
	  $temp.operation = "edit"
	  $spec.deviceChange += $temp
    }
  }
  $_.ReconfigVM_Task($spec)
  Remove-Variable $spec
}
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 18:18:48 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/1519031#M48770</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2008-12-01T18:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/2994035#M113692</link>
      <description>&lt;P&gt;Hi LucD,&lt;/P&gt;&lt;P&gt;Your script looks gr8, can you modify it so that the serial ports which output to a file on a datastore are modified so that they can be pointed to a new datastore? I need this code in order to migrate VMs off datastores which are to be decomed.&lt;/P&gt;&lt;P&gt;I've noticed that when I manually edit the VM settings, the new com files are created on the new datastores however the old ones are still present on the original datastore?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 07:43:17 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/2994035#M113692</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-11-03T07:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/2994102#M113695</link>
      <description>&lt;P&gt;You can indeed use a similar method to change the Datastore location to which serial port will write.&lt;BR /&gt;But changing the destination this way, will not automatically remove the old file.&lt;BR /&gt;You will need to do that separately.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 14:02:50 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/2994102#M113695</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-11-03T14:02:50Z</dc:date>
    </item>
  </channel>
</rss>

