<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>powercli get vmware tools version Archives - the Sysadmin Channel</title>
	<atom:link href="https://thesysadminchannel.com/tag/powercli-get-vmware-tools-version/feed/" rel="self" type="application/rss+xml" />
	<link>https://thesysadminchannel.com/tag/powercli-get-vmware-tools-version/</link>
	<description>Documenting My Life as a System Administrator</description>
	<lastBuildDate>Wed, 23 Dec 2020 01:23:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
<site xmlns="com-wordpress:feed-additions:1">144174110</site>	<item>
		<title>Use PowerCLI To Check VMware Tools Status</title>
		<link>https://thesysadminchannel.com/powercli-check-vmware-tools-status/</link>
					<comments>https://thesysadminchannel.com/powercli-check-vmware-tools-status/#respond</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Mon, 07 Sep 2020 06:17:08 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[PowerCLI Check VMware Tools Status]]></category>
		<category><![CDATA[powercli get vmware tools version]]></category>
		<category><![CDATA[powercli vmtools version status]]></category>
		<category><![CDATA[powercli vmware tools status]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=2584</guid>

					<description><![CDATA[<p>If you&#8217;re running a VMware environment you might be wondering if there was a way to use PowerCLI To Check VMware Tools Status. The reason for checking it through the command line is so you can check the virtual machines&#8230; <a href="https://thesysadminchannel.com/powercli-check-vmware-tools-status/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/powercli-check-vmware-tools-status/">Use PowerCLI To Check VMware Tools Status</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;re running a VMware environment you might be wondering if there was a way to use <strong>PowerCLI To Check VMware Tools Status</strong>.  The reason for checking it through the command line is so you can check the virtual machines in bulk.  This can be done in the GUI but this option really isn&#8217;t scalable.</p>
<div id="attachment_2585" style="width: 1053px" class="wp-caption aligncenter"><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/VMware-Tools-GUI-status.png" target="_blank" rel="noopener noreferrer"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-2585" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/VMware-Tools-GUI-status.png" alt="VMware Tools GUI status" width="1043" height="379" class="size-full wp-image-2585" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/VMware-Tools-GUI-status.png?v=1608605398 1043w, https://thesysadminchannel.com/wp-content/uploads/2020/12/VMware-Tools-GUI-status-1024x372.png?v=1608605398 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/12/VMware-Tools-GUI-status-768x279.png?v=1608605398 768w" sizes="(max-width: 1043px) 100vw, 1043px" /></a><p id="caption-attachment-2585" class="wp-caption-text">Screenshot for GUI method</p></div>
<p>As you can see from my screenshot above, I&#8217;m up to date on my windows 10 machine. However, as I mentioned already this method is not scalable at all so this is why I prefer the Powershell PowerCLI method.</p>
<h2>Understanding The VM Properties in PowerCLI</h2>
<p>I should probably start off by explaining the properties that are available with the Get-VM cmdlet as this will lay down the foundation for what we&#8217;re trying to do.  Anytime you run the command Get-VM -Name <em>MyComputer</em> it will output that VM along with the default properties of Name, PowerState, NumCPUs and MemoryGB.</p>
<p>There are more properties available but just not available from the default output.  Thus we will need to pipe it to FL (or Format-List). That would look like this. <code>Get-VM -Name PAC-WIN1001| fl</code></p>
<p>&nbsp;<br />
What I prefer to use when checking what&#8217;s available is setting the output into a variable and quickly finding those properties.  This way we can use the $VM.Property1.property2 etc..</p>
<p>In our case we&#8217;re going to be drilling down to the <strong>ExtensionData</strong> -> <strong>Guest </strong> properties and there we will find our vmtools information.</p>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/VMware-Tools-ExtensionData-Guest-Info.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/VMware-Tools-ExtensionData-Guest-Info.png" alt="VMware Tools ExtensionData Guest Info" width="1099" height="602" class="aligncenter size-full wp-image-2590" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/VMware-Tools-ExtensionData-Guest-Info.png?v=1608607164 1099w, https://thesysadminchannel.com/wp-content/uploads/2020/12/VMware-Tools-ExtensionData-Guest-Info-1024x561.png?v=1608607164 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/12/VMware-Tools-ExtensionData-Guest-Info-768x421.png?v=1608607164 768w" sizes="(max-width: 1099px) 100vw, 1099px" /></a></p>
<h2>Use PowerCLI To Check VMware Tools Status &#8211; Powershell Script</h2>
<h3>Script Requirements</h3>
<ul>
<li>Must have the PowerCLI module installed</li>
<li>Must be connected to vCenter server (or individual host) via PowerCLI</li>
</ul>
<h3>Parameters</h3>
<h4>    -Name</h4>
<p>Description: Enter the virtual machine name that&#8217;s listed in vcenter</p>
<h4>    -InputObject</h4>
<p>Description: Allows pipeline input through the Get-VM cmdlet.</p>
<h3>Examples</h3>
<p><strong>Example 1:</strong><br />
Get-VMToolsStatus -Name VM1, VM2, VM3<br />
&nbsp;<br />
<strong>Example 2:</strong><br />
Get-VM -Name VM1, VM2, VM3 | Get-VMToolsStatus</p>
<div id="attachment_2600" style="width: 920px" class="wp-caption aligncenter"><a href="https://thesysadminchannel.com/wp-content/uploads/2020/09/PowerCLI-To-Check-VMware-Tools-Status.png" target="_blank" rel="noopener noreferrer"><img decoding="async" aria-describedby="caption-attachment-2600" src="https://thesysadminchannel.com/wp-content/uploads/2020/09/PowerCLI-To-Check-VMware-Tools-Status.png" alt="PowerCLI To Check VMware Tools Status" width="910" height="473" class="size-full wp-image-2600" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/09/PowerCLI-To-Check-VMware-Tools-Status.png?v=1608681036 910w, https://thesysadminchannel.com/wp-content/uploads/2020/09/PowerCLI-To-Check-VMware-Tools-Status-768x399.png?v=1608681036 768w" sizes="(max-width: 910px) 100vw, 910px" /></a><p id="caption-attachment-2600" class="wp-caption-text">This script also supports pipeline input</p></div>
<h3>Powershell PowerCLI Script</h3>
<pre class="brush: powershell; title: ; notranslate">

Function Get-VMToolsStatus {
&lt;#
.SYNOPSIS
    This will check the status of the VMware vmtools status.
    Properties include Name, Status, UpgradeStatus and Version

.NOTES
    Name: Get-VMToolsStatus
    Author: theSysadminChannel
    Version: 1.0
    DateCreated: 2020-Sep-1

.LINK
    https://thesysadminchannel.com/powercli-check-vmware-tools-status/ -

.EXAMPLE
    Please refer to the -Online version
    help Get-VMToolsStatus -Online

#&gt;

    [CmdletBinding()]
    param(
        [Parameter(
            Position=0,
            ParameterSetName=&quot;NonPipeline&quot;
        )]
        [Alias(&quot;VM&quot;, &quot;ComputerName&quot;, &quot;VMName&quot;)]
        [string[]]  $Name,


        [Parameter(
            Position=1,
            ValueFromPipeline=$true,
            ValueFromPipelineByPropertyName=$true,
            ParameterSetName=&quot;Pipeline&quot;
            )]
        [PSObject[]]  $InputObject
    )

    BEGIN {
        if (-not $Global:DefaultVIServer) {
            Write-Error &quot;Unable to continue.  Please connect to a vCenter Server.&quot; -ErrorAction Stop
        }

        #Verifying the object is a VM
        if ($PSBoundParameters.ContainsKey(&quot;Name&quot;)) {
            $InputObject = Get-VM $Name
        }

        $i = 1
        $Count = $InputObject.Count
    }

    PROCESS {
        if (($null -eq $InputObject.VMHost) -and ($null -eq $InputObject.MemoryGB)) {
            Write-Error &quot;Invalid data type. A virtual machine object was not found&quot; -ErrorAction Stop
        }

        foreach ($Object in $InputObject) {
            try {
                [PSCustomObject]@{
                    Name = $Object.name
                    Status = $Object.ExtensionData.Guest.ToolsStatus
                    UpgradeStatus = $Object.ExtensionData.Guest.ToolsVersionStatus2
                    Version = $Object.ExtensionData.Guest.ToolsVersion
                }
            } catch {
                Write-Error $_.Exception.Message

            } finally {
                if ($PSBoundParameters.ContainsKey(&quot;Name&quot;)) {
                    $PercentComplete = ($i/$Count).ToString(&quot;P&quot;)
                    Write-Progress -Activity &quot;Processing VM: $($Object.Name)&quot; -Status &quot;$i/$count : $PercentComplete Complete&quot; -PercentComplete $PercentComplete.Replace(&quot;%&quot;,&quot;&quot;)
                    $i++
                } else {
                    Write-Progress -Activity &quot;Processing VM: $($Object.Name)&quot; -Status &quot;Completed: $i&quot;
                    $i++
                }
            }
        }
    }

    END {}
}

</pre>
<p>&nbsp;<br />
Hopefully you found some value from this post and can now use this script in your environment. It&#8217;s always a good idea to do a basic audit to see what&#8217;s not up to standard.  Speaking of audit,  I would also suggest you take a look at the <a href="https://thesysadminchannel.com/get-vminformation-using-powershell-and-powercli/" rel="noopener noreferrer" target="_blank">VMware VM Information Script</a> which will give you specific details on host, cluster, datacenter, datastore, network, IP address etc.. It&#8217;s actually pretty neat and yours for the taking.</p>
<p>If you&#8217;re more into video learning, be sure to check out our <a href="https://www.youtube.com/c/theSysadminChannel" rel="noopener noreferrer" target="_blank">Youtube Channel</a> for sysadmin video content.</p>
<p>The post <a href="https://thesysadminchannel.com/powercli-check-vmware-tools-status/">Use PowerCLI To Check VMware Tools Status</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/powercli-check-vmware-tools-status/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2584</post-id>	</item>
	</channel>
</rss>
