<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>VMware PowerCLI Blog</title>
	
	<link>http://blogs.vmware.com/vipowershell</link>
	<description>PowerCLI is the best tool for automating management and configuration of VMware vSphere</description>
	<lastBuildDate>Tue, 07 May 2013 16:38:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/VMware/PowerCLIBlog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="vmware/powercliblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Vote PowerCLI at VMworld 2013</title>
		<link>http://blogs.vmware.com/vipowershell/2013/05/vote-powercli-at-vmworld-2013.html</link>
		<comments>http://blogs.vmware.com/vipowershell/2013/05/vote-powercli-at-vmworld-2013.html#comments</comments>
		<pubDate>Thu, 02 May 2013 19:41:57 +0000</pubDate>
		<dc:creator>Alan Renouf</dc:creator>
				<category><![CDATA[VMworld]]></category>

		<guid isPermaLink="false">https://blogs.vmware.com/vipowershell/?p=1469</guid>
		<description><![CDATA[Its time to vote for VMworld sessions again and this year there are a whopping 13 PowerCLI related sessions in the public voting for you to select, that’s a lot more than last year. There is a good variety of &#8230; <a href="http://blogs.vmware.com/vipowershell/2013/05/vote-powercli-at-vmworld-2013.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.vmware.com/vipowershell/files/2013/05/image.png"><img style="background-image: none; float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 0px 5px; display: inline; padding-right: 0px; border: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/05/image_thumb.png" alt="image" width="240" height="136" align="right" border="0" /></a>Its time to vote for VMworld sessions again and this year there are a whopping 13 PowerCLI related sessions in the public voting for you to select, that’s a lot more than last year.</p>
<p>There is a good variety of sessions from learning up to the expert, from VMware engineers (The guys who wrote PowerCLI) and also customers who use PowerCLI.</p>
<p>Personally I would like to accept all of them but hey, its down to you so go to the <a href="http://www.vmworld.com/cfp.jspa" target="_blank">VMworld Voting Page</a> sign in and vote for your top sessions.</p>
<p>I&#8217;m looking forward to automation and fun filled VMworld this year!</p>
<table style="border-collapse: collapse; border-bottom-style: none;" width="100%" border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col style="width: 106pt; mso-width-source: userset; mso-width-alt: 5156;" width="141" />
<col style="width: 635pt; mso-width-source: userset; mso-width-alt: 30939;" width="846" /></colgroup>
<tbody>
<tr style="height: 15pt;">
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="141" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>4887</strong></span></span></td>
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="846"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>The PowerCLI &#8211; vSphere API Rosetta Stone</strong></span></span></td>
</tr>
<tr style="height: 105pt;">
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="141" height="140"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Josh Atwell<br />
Conrad Ramos</span></span></td>
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="846"><span style="font-family: Calibri;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Occasionally tasks that are simple in the vSphere GUI are not available as part of the native PowerCLI cmdlets. Automating these tasks require digging deeper into vSphere’s API, which is foreign to most PowerCLI scripters. PowerCLI can directly communicate with this API if you know the right places to look.</span></span></span>Attendees will learn how to navigate the vSphere API to identify the methods required to perform these tasks. Additionally attendees will learn the basics on how to integrate these mysterious methods into PowerCLI through proven examples. We’ll help you learn the language of the vSphere API and translate it into powerful scripts and functions.</td>
</tr>
<tr style="height: 15pt;">
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>4910</strong></span></span></td>
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>Racking up Oracle RAC with PowerCLI</strong></span></span></td>
</tr>
<tr style="height: 195pt;">
<td class="xl66" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" height="260"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Maish Saidel-Keesing</span></span></td>
<td class="xl67" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" width="846"><span style="font-family: Calibri;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Have you ever set up Oracle RAC? Have you ever counted how many steps it takes to perform the full installation? How many of those have to be performed manually?</span></span></span>Wouldn&#8217;t it be great to set up your Oracle RAC cluster with a minimal amount of steps and let the rest all be handled automatically?This Session will supply the use case of how our company managed to automate the full installation of Oracle RAC. Converting a manual, highly error prone and frustrating process, to something that is now 100% automated, and has reduced to the time to deploy a fully functional RAC cluster from 12-16 hours of manual work to a 60-90 minute automated process.The session will go through the workflow needed to complete a RAC installation &#8211; and will show you how we leveraged some our built-in processes and the vSphere API to complete the rest of the work.</p>
<p>The session will include a live demo of a full RAC installation from start to finish.</td>
</tr>
<tr style="height: 15pt;">
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>4944</strong></span></span></td>
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>PowerCLI Best Practices &#8211; A Deep Dive</strong></span></span></td>
</tr>
<tr style="height: 135pt;">
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="141" height="180"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Luc Dekens<br />
Alan Renouf</span></span></td>
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="846"><span style="font-family: Calibri;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">In previous years Alan and Luc showed you some of their best practices and how to take PowerCLI one step further.<br />
This year they will dive deeper and show you some best practices you didn’t see coming.</span></span></span>- The Software Defined Datacenter<br />
- Taking on the MOB and winning<br />
- From vSwitch to vDS<br />
- Pimp your performance graphs<br />
- Common and Cool Community Questions<br />
&#8230;</td>
</tr>
<tr style="height: 15pt;">
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>4983</strong></span></span></td>
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>PowerCLI for dummies</strong></span></span></td>
</tr>
<tr style="height: 45pt;">
<td class="xl66" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" height="60"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Noam Perimann</span></span></td>
<td class="xl67" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" width="846"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">In this customer case study, an IT generalist shares real-world PowerCLI scripting solutions to monitoring and maintenance challenges in a Windows environment. Integrating vm-level and guest-level scripting, holistic automation is presented in digestible pieces. Even a dummy can become a productive automator.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>5019</strong></span></span></td>
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>Automating Horizon View Administration with PowerCLI and LDAP</strong></span></span></td>
</tr>
<tr style="height: 135pt;">
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="141" height="180"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Jack McMichael</span></span></td>
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="846"><span style="font-family: Calibri;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">As large Horizon View deployments scale up, so does the administration tasks that accompany it. Ease the pain of administration tasks, pool deployment, user entitlement, and desktop image management with the use of PowerCLI and the Horizon View ADLDS instance.</span></span></span>In this advanced technical session we&#8217;ll setup our Connection Broker for use with PowerCLI. We&#8217;ll examine the most commonly used PowerCLI cmdlets and put them to use in real world examples that will help you streamline administration or create automated tasks to better manage a Horizon View environment. We&#8217;ll navigate into the Horizon View ADLDS instance to understand the information available, make you comfortable manipulating data when necessary, and show how you can integrate LDAP queries into scripts to aggregate the information you need that Horizon View Administrator may not show you.</td>
</tr>
<tr style="height: 15pt;">
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>5166</strong></span></span></td>
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>How to manage and automate large scale Cloud deployments through PowerShell / PowerCLI</strong></span></span></td>
</tr>
<tr style="height: 180pt;">
<td class="xl66" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" height="240"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Sajal Debnath</span></span></td>
<td class="xl67" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" width="846"><span style="font-family: Calibri;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">The overall aim of this session is to enable cloud admins to effectively utilize PowerShell / PowerCLI in their day to day tasks to make it easier for them to manage the complex environments.</span></span></span>The session starts with a discussion on common needs for automation in cloud environment, different methods of achieving same and their respective merits and demerits. It will then go on to discuss available PowerShell / PowerCLI way of automating and managing cloud environment. Different categories of cmdlets available under PowerCLI for vCloud environment and their uses and applications.Next it takes sample use cases and solve those using PowerShell scripts, describing in detail about the working of the scripts so that general idea can be gained about the requirements and how to approach to provide solutions to meet the requirements.In this stepwise approach has been taken where it starts from simple scripts and then gradually goes to more complex scripts.</td>
</tr>
<tr style="height: 15pt;">
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>5287</strong></span></span></td>
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>Open up the vCloud hood using PowerCLI, Hyperic, vCenter Operations Manager and vCenter Orchestrator to reveal the inner cloud.</strong></span></span></td>
</tr>
<tr style="height: 90pt;">
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="141" height="120"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Phil Ditzel<br />
Cathal Cleary</span></span></td>
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="846"><span style="font-family: Calibri;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Are you a vCloud service provider? Are you a vCloud consumer? Do you have enough visibility of what’s happening under vCloud Director’s hood?</span></span></span>This session will discuss tools and techniques for both the provider and consumer to open up the vCloud box and allow for higher levels of utilization. We will demonstrate techniques using PowerCLI, vFabric Hyperic, vCenter Operations Manager and vCenter Orchestrator to add both provider and consumer instrumentation to vCloud Director.</td>
</tr>
<tr style="height: 15pt;">
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>5298</strong></span></span></td>
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>PowerCLI &#8211; from Youngling to Master</strong></span></span></td>
</tr>
<tr style="height: 120pt;">
<td class="xl66" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" height="160"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Hans De Leenheer</span></span></td>
<td class="xl67" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" width="846"><span style="font-family: Calibri;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Learning a new technology is like learning a new language. It is especially so if you want to learn a scripting language. At the VMware Community Podcast of March 27th, where the topic was PowerCLI, a question got raised where you should start when you are a rookie. The answer was &#8220;many places&#8221;. As a result of that PowerCLIforDummies.com got created that would be just that landing place to start.</span></span></span>Making it interesting the website evolves through the stages of learning a new language. To keep it geek enough the learning process has been aligned with the Jedi ranks. By the end of this session you will know how to grow from Youngling to Apprentice, Knight and in the end become a real PowerCLI Master.</td>
</tr>
<tr style="height: 15pt;">
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>5338</strong></span></span></td>
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>What’s in PowerCLI for me?</strong></span></span></td>
</tr>
<tr style="height: 75pt;">
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="141" height="100"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Andrey Anastasov<br />
Vladimir Goranov</span></span></td>
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="846"><span style="font-family: Calibri;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Have you ever felt like you are doing the same thing over and over again? Are you tired of clicking with the mouse through tedious user interfaces and endless wizards? Are you having trouble keeping up with the loads of work around your virtual infrastructure?</span></span></span>Then you might use some help – and PowerCLI is the tool for you! It lets you automate all aspects of your work: reporting, provisioning, and large-scale changes, to name a few. PowerCLI is powerful, yet easy to use.</td>
</tr>
<tr style="height: 15pt;">
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>5340</strong></span></span></td>
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>What everybody ought to know about reporting in the software-defined data center with PowerCLI</strong></span></span></td>
</tr>
<tr style="height: 90pt;">
<td class="xl67" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" width="141" height="120"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Andrey Anastasov<br />
Vladimir Goranov</span></span></td>
<td class="xl67" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" width="846"><span style="font-family: Calibri;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Administrators: Do you know what is going on in your virtual environment? Are you aware of the current trends in its usage? Are you in control of your software-defined infrastructure?</span></span></span>PowerCLI will help you report on all aspects of your virtual environment and cloud infrastructure. Learn how to write simple yet powerful PowerCLI reports in various formats. Discover the five PowerCLI reports no vSphere administrator can live without and the amazing reporting capabilities PowerCLI provides for the software-defined data center.</td>
</tr>
<tr style="height: 15pt;">
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>5479</strong></span></span></td>
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>To the Cloud, with PowerCLI!</strong></span></span></td>
</tr>
<tr style="height: 45pt;">
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="141" height="60"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Jake Robinson<br />
Alan Renouf</span></span></td>
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="846"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">PowerCLI has become one of the most powerful and easy to use tools in a vSphere admin’s arsenal. Since version 5.01 this also includes the ability to manage your workloads in the public cloud. This session will show you the power you have to manage workloads at any vCloud provider, see how easy it is to create, manage and report on your cloud workloads with PowerCLI</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>5554</strong></span></span></td>
<td class="xl69" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>How to use the new PowerCLI VMware vSphere Distributed Switch cmdlets and become a PowerCLI superstar</strong></span></span></td>
</tr>
<tr style="height: 105pt;">
<td class="xl67" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" width="141" height="140"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Robert van den Nieuwendijk</span></span></td>
<td class="xl67" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: white;" width="846"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">While the VMware vSphere Distributed Switch has been around since vSphere 4, official vSphere PowerCLI support for the VMware vSphere Distributed Switch was just recently introduced in VMware vSphere PowerCLI 5.1 Release 2. This session will provide a technical deep dive into the new PowerCLI cmdlets to manage a vSphere Distributed Switch. You will learn how to configure and manage a vSphere Distributed Switch using PowerCLI. Exporting and importing the configuration of a vSphere Distributed switch will be discussed in depth. You will learn how to import the configuration of a vSphere Distributed switch to create new distributed switches and port groups, or to modify existing ones. Finally migrating a standard vSwitch to a vSphere Distributed Switch will be highlighted.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>5731</strong></span></span></td>
<td class="xl68" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"><strong>Become a Rock Star with PowerCLI and vCenter Orchestrator &#8211; Now with more Cowbell</strong></span></span></td>
</tr>
<tr style="height: 60pt;">
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="141" height="80"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Josh Atwell</span></span></td>
<td class="xl65" style="border-top-style: none; vertical-align: bottom; padding-bottom: 0px; padding-top: 1px; padding-left: 1px; padding-right: 1px; background-color: #b8cce4;" width="846"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Automation is the future of cloud and in this session attendees will learn how to identify areas in their environment that are primed for less administrator interaction. The combination of PowerCLI and vCenter Orchestrator puts considerable power in even the greenest users. Attendees will learn how to identify areas for automation and start learning to discern which tool is best suited for the job and when to use them together.</span></span></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vmware.com/vipowershell/2013/05/vote-powercli-at-vmworld-2013.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joining ESXi hosts to a domain and granting permissions with PowerCLI</title>
		<link>http://blogs.vmware.com/vipowershell/2013/04/joining-esxi-hosts-to-a-domain-and-granting-permissions-with-powercli.html</link>
		<comments>http://blogs.vmware.com/vipowershell/2013/04/joining-esxi-hosts-to-a-domain-and-granting-permissions-with-powercli.html#comments</comments>
		<pubDate>Tue, 30 Apr 2013 19:26:03 +0000</pubDate>
		<dc:creator>Alan Renouf</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">https://blogs.vmware.com/vipowershell/?p=1461</guid>
		<description><![CDATA[Recently I was asked by an administrator to help him automate the process of joining ESXi Hosts or as PowerCLI refers to them “VMhosts” to a domain and granting permissions for a domain user with PowerCLI. In this post I &#8230; <a href="http://blogs.vmware.com/vipowershell/2013/04/joining-esxi-hosts-to-a-domain-and-granting-permissions-with-powercli.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I was asked by an administrator to help him automate the process of joining ESXi Hosts or as PowerCLI refers to them “VMhosts” to a domain and granting permissions for a domain user with PowerCLI.</p>
<p>In this post I am going to show you how this can be done with a few lines of code and also share my lessons learned throughout this process. Let’s assume that you have list of VMhost IP addresses and all VMhosts have the same local administrator credentials, you want to join them to a domain and grant permissions for a domain user or group account assigning it a specific role. In the script I assume the role exists on the VMHost but later I will show you how to create a custom role.</p>
<p>The Set-VMHostAuthentication cmdlet is used for joining a VMhost to a domain. You should have in mind that the full domain name must be specified on the Domain parameter of the cmdlet.</p>
<p><strong>Get-VMHostAuthentication</strong> <em>-VMHost</em> &lt;VMHost&gt;| <strong>Set-VMHostAuthentication</strong> <em>-Domain</em> &lt;domain fullname&gt; <em>-User</em> &lt;domain user name for authentication&gt; <em>-Password</em> &lt;password for authentication&gt; <em>-JoinDomain -Confirm</em>:$false</p>
<p>The New-VIPermssion cmdlet is used for creating permissions for a specified user. The user is obtained with the Get-VIAccount cmdlet which has the ability to retrieve Domain user or group accounts when the VMHost is joined to a domain. In contrast to Set-VMHostAuthentication the Domain parameter of Get-VIAccount expects the domain alias instead of domain full name.</p>
<p>You should also be aware that if you don’t specify an Id filter to the Get-VIAccount cmdlet it returns the maximum 5000 results and for domains with many accounts this could be a constraint. So it is recommended to use Id filter of the cmdlet itself instead of applying filtering over its results.</p>
<p>To obtain domain user accounts use –User switch.</p>
<p><span style="font-family: Consolas;"><strong>Get-VIAccount</strong> <em>-Domain</em> &lt;domain alias&gt; <em>-User -Id</em> &lt;user name filter&gt;</span></p>
<p>To obtain domain group accounts use –Group switch.</p>
<p><span style="font-family: Consolas;"><strong>Get-VIAccount</strong> <em>-Domain</em> &lt;domain alias&gt; <em>-Group -Id</em> &lt;group name filter&gt;</span></p>
<p>To grant permissions you should specify account to Principal parameter returned by the Get-VIAccount cmdlet, role which can be obtained by Get-VIRole or specified by name and entity which in our case will be the VM host.</p>
<p><span style="font-family: Consolas;"><strong>New-VIPermission</strong> <em>-Principal</em> &lt;VIAccount&gt; <em>-Role</em> &lt;VIRole&gt; <em>-Entity</em> &lt;VMHost&gt;</span></p>
<p>Here is the entire script with a lot of input parameters needed by the used cmdlets in the script but the script itself is not complex:</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="font-size: 10pt;">param</span></span><span><span style="font-size: 10pt;"> (</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[Parameter(Mandatory</span></span><span style="font-size: 10pt;"><span>=</span><span>$true</span><span>, HelpMessage</span><span>=</span><span>"List of VM host IPs"</span></span><span><span style="font-size: 10pt;">)]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[ValidateNotNull()]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[</span></span><span style="font-size: 10pt;"><span>string</span></span><span><span style="font-size: 10pt;">[]]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span></span><span style="font-size: 10pt;"><span>$vmHostIPs</span></span><span><span style="font-size: 10pt;">,</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[Parameter(Mandatory</span></span><span style="font-size: 10pt;"><span>=</span><span>$true</span><span>, HelpMessage</span><span>=</span><span>"VM Host User Name"</span></span><span><span style="font-size: 10pt;">)]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[ValidateNotNull()]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[</span></span><span style="font-size: 10pt;"><span>string</span></span><span><span style="font-size: 10pt;">]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span></span><span style="font-size: 10pt;"><span>$vmHostUserName</span></span><span><span style="font-size: 10pt;">,</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[Parameter(Mandatory</span></span><span style="font-size: 10pt;"><span>=</span><span>$true</span><span>, HelpMessage</span><span>=</span><span>"VM Host Password"</span></span><span><span style="font-size: 10pt;">)]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[ValidateNotNull()]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[</span></span><span style="font-size: 10pt;"><span>string</span></span><span><span style="font-size: 10pt;">]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span></span><span style="font-size: 10pt;"><span>$vmHostPassword</span></span><span><span style="font-size: 10pt;">,</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[Parameter(Mandatory</span></span><span style="font-size: 10pt;"><span>=</span><span>$true</span><span>,HelpMessage</span><span>=</span><span>"Domain full name, required for joining hosts."</span></span><span><span style="font-size: 10pt;">)]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[ValidateNotNull()]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[</span></span><span style="font-size: 10pt;"><span>string</span></span><span><span style="font-size: 10pt;">]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span></span><span style="font-size: 10pt;"><span>$domainlFullName</span></span><span><span style="font-size: 10pt;">,</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt; color: #000000; font-family: Consolas;">   </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[Parameter(Mandatory</span></span><span style="font-size: 10pt;"><span>=</span><span>$true</span><span>,HelpMessage</span><span>=</span><span>"Domain alias, required for retrieving domain accounts."</span></span><span><span style="font-size: 10pt;">)]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[ValidateNotNull()]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[</span></span><span style="font-size: 10pt;"><span>string</span></span><span><span style="font-size: 10pt;">]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span></span><span style="font-size: 10pt;"><span>$domainAlias</span></span><span><span style="font-size: 10pt;">,</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[Parameter(Mandatory</span></span><span style="font-size: 10pt;"><span>=</span><span>$true</span><span>, HelpMessage</span><span>=</span><span>"User name for domain authentication"</span></span><span><span style="font-size: 10pt;">)]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[ValidateNotNull()]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[</span></span><span style="font-size: 10pt;"><span>string</span></span><span><span style="font-size: 10pt;">]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span></span><span style="font-size: 10pt;"><span>$domainUser</span></span><span><span style="font-size: 10pt;">,</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[Parameter(Mandatory</span></span><span style="font-size: 10pt;"><span>=</span><span>$true</span><span>, HelpMessage</span><span>=</span><span>"Password for domain authentication"</span></span><span><span style="font-size: 10pt;">)]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[ValidateNotNull()]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[</span></span><span style="font-size: 10pt;"><span>string</span></span><span><span style="font-size: 10pt;">]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span></span><span style="font-size: 10pt;"><span>$domainPassword</span></span><span><span style="font-size: 10pt;">,</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt; color: #000000; font-family: Consolas;">   </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[Parameter(Mandatory</span></span><span style="font-size: 10pt;"><span>=</span><span>$true</span><span>, HelpMessage</span><span>=</span><span>"Domain user name for which permissions will be granted"</span></span><span><span style="font-size: 10pt;">)]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[ValidateNotNull()]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[</span></span><span style="font-size: 10pt;"><span>string</span></span><span><span style="font-size: 10pt;">]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span></span><span style="font-size: 10pt;"><span>$userNameToGrantPermissions</span></span><span><span style="font-size: 10pt;">,</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt; color: #000000; font-family: Consolas;">   </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[Parameter(Mandatory</span></span><span style="font-size: 10pt;"><span>=</span><span>$true</span><span>, HelpMessage</span><span>=</span><span>"The name of the role you will assign to the user"</span></span><span><span style="font-size: 10pt;">)]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[ValidateNotNull()]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span><span style="font-size: 10pt;">[</span></span><span style="font-size: 10pt;"><span>string</span></span><span><span style="font-size: 10pt;">]</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">   </span></span></span><span><span style="font-size: 10pt;">$roleName</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;">)</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="font-size: 10pt;">foreach</span></span><span style="font-size: 10pt;"><span> (</span><span>$vmHostIP</span><span>in</span><span>$vmHostIPs</span></span><span><span style="font-size: 10pt;">) {</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">    </span></span></span><span><span style="font-size: 10pt;"># Establish connection to a VMHost</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">    </span></span></span><span style="font-size: 10pt;"><span>$vmHostConnection</span><span>=</span><span> Connect-VIServer</span><em><span>-Server</span></em><span> $vmHostIP</span><em><span> -User</span></em><span> $vmHostUserName </span><em><span>-Password </span></em></span><span><span style="font-size: 10pt;">$vmHostPassword</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 1;"><span style="font-size: 10pt;">      </span></span></span><span style="font-size: 10pt;"><span>try</span></span><span><span style="font-size: 10pt;"> {</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span><span style="font-size: 10pt;"># Get VMHost instance</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>$vmHost</span><span>=</span><span> Get-VMHost </span><em><span>-Server</span></em></span><span><span style="font-size: 10pt;"> $vmHostConnection</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="mso-tab-count: 1;"><span style="font-size: 10pt; color: #000000; font-family: Consolas;">      </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span><span style="font-size: 10pt;"># Join the VMHost to a domain</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>Get-VMHostAuthentication </span><em><span>-VMHost</span></em><span> $vmHost</span><span> | Set-VMHostAuthentication</span><em><span> -Domain </span></em><span>$domainlFullName</span><em><span> -User </span></em><span>$domainUser</span><em><span> -Password</span></em><span> $domainPassword</span><em><span> -JoinDomain</span></em><em><span> -Confirm</span></em><span>:</span></span><span><span style="font-size: 10pt;">$false</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span><span style="font-size: 10pt;"># Get a domain account</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>$viAccount</span><span>=</span><span> Get-VIAccount </span><em><span>-Domain</span></em><span> $domainAlias </span><em><span>-User</span></em><em><span> -Id </span></em><span>$userNameToGrantPermissions</span></span><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">         </span></span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>if</span><span> (</span><span>-not</span><span> $viAccount</span></span><span><span style="font-size: 10pt;">) {</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 3;"><span style="font-size: 10pt;">                  </span></span></span><span style="font-size: 10pt;"><span>throw</span></span><span><span style="font-size: 10pt;"> &#8220;VIAccount with Id &#8216;$userNameToGrantPermissions&#8217; not found in domain &#8216;$domainAlias&#8217;&#8221;</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span><span style="font-size: 10pt;">}</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span><span style="font-size: 10pt;"># Get role to assign</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>$viRole</span><span>=</span><span> Get-VIRole </span><em><span>-Name</span></em></span><span><span style="font-size: 10pt;"> $roleName</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>if</span><span> (</span><span>-not</span><span> $viRole</span></span><span><span style="font-size: 10pt;">) {</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 3;"><span style="font-size: 10pt;">                  </span></span></span><span style="font-size: 10pt;"><span>throw </span></span><span><span style="font-size: 10pt;">&#8220;VIRole with name &#8216; $viRole&#8217; not found.&#8221;</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span><span style="font-size: 10pt;">}</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span><span style="font-size: 10pt;"># Add permissions on VMHost</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>New-VIPermission </span><em><span>-Principal </span></em><span>$viAccount </span><em><span>-Role </span></em><span>$viRole</span><em><span> -Entity </span></em><span>$vmHost</span></span><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">          </span></span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 1;"><span style="font-size: 10pt;">      </span></span><span style="font-size: 10pt;">} </span></span><span style="font-size: 10pt;"><span>catch</span></span><span><span style="font-size: 10pt;"> {</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>Write-Error (</span><span>&#8220;The following error has occurred for VMHost &#8216;$vmHost&#8217;: `r`n&#8221;</span><span>+</span><span>$_</span></span><span><span style="font-size: 10pt;">)</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 1;"><span style="font-size: 10pt;">      </span></span><span style="font-size: 10pt;">} </span></span><span style="font-size: 10pt;"><span>finally</span></span><span><span style="font-size: 10pt;"> {</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>Disconnect-VIServer </span><span>$vmHostConnection</span><em><span> -Confirm</span></em><span>:</span></span><span><span style="font-size: 10pt;">$false</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-tab-count: 1;"><span style="font-size: 10pt;">      </span></span><span style="font-size: 10pt;">}</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;">}</span></span></p>
<p>&nbsp;</p>
<p>As you can see the script opens a connection to each VMhost, joins it to the domain and creates permissions for a specific domain account. It relies on the existing role on the VMHost, but it can be easily modified to create a custom role and assign it to the obtained user.</p>
<p>To create a new custom role the New-VIRole cmdlet needs to be used specifying a name and list of privileges on its input. Here is an example:</p>
<p><span style="font-family: Consolas;"><strong>New-VIRole</strong> <em>-Name</em> MyCustomRole <em>-Privilege</em> &#8216;Anonymous&#8217;, &#8216;View&#8217;, &#8216;Read&#8217;, &#8216;Power On&#8217;, &#8216;Power Off&#8217;</span></p>
<p>The script is calling the Get-VIAccount with a –User switch parameter which filters on domain user accounts. In order to retrieve a domain group account the –Group switch parameter should be used.</p>
<p>So the script looks pretty simple and straightforward but running it I’ve experienced the following problem. Sometimes Get-VIAccount failed to retrieve the domain user immediately after joining the VMhost to the domain and I received the following error “Error accessing directory: Can&#8217;t bind to LDAP server for domain: &lt;DOMAIN&gt;”.</p>
<p>It seems that synchronization with active directory needs some time after a host is joined to the domain and the problem is not 100% reproducible. So I solved it with a simple retry-wait mechanism on retrieving domain users.</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;"># Get a domain account</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="font-size: 10pt;">$viAccount</span></span><span style="font-size: 10pt;"><span>=</span></span><span><span style="font-size: 10pt;">$null</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="font-size: 10pt;">$retryCount</span></span><span style="font-size: 10pt;"><span>=</span></span><span><span style="font-size: 10pt;"> 5</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="font-size: 10pt;">while</span></span><span style="font-size: 10pt;"><span> ((</span><span>-not</span><span>$viAccount</span><span>) </span><span>-and</span><span> (</span><span>$retryCount</span><span>-ge</span></span><span><span style="font-size: 10pt;"> 0)) {</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 1;"><span style="font-size: 10pt;">      </span></span></span><span style="font-size: 10pt;"><span>try</span></span><span><span style="font-size: 10pt;"> {</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>$viAccount</span><span>=</span><span> Get-VIAccount</span><em><span>-Domain</span></em><span>$domainAlias</span><em><span>-User</span></em><em><span>-Id</span></em></span><span><span style="font-size: 10pt;">$userNameToGrantPermissions</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 1;"><span style="font-size: 10pt;">      </span></span><span style="font-size: 10pt;">} </span></span><span style="font-size: 10pt;"><span>catch</span></span><span><span style="font-size: 10pt;"> {</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>Write-Error </span></span><span><span style="font-size: 10pt;">&#8220;Getting VIAccount with Id &#8216;$userNameToGrantPermissions&#8217; failed with the following error: `r`n $_&#8221;</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>Write-Host </span></span><span><span style="font-size: 10pt;">&#8220;Next attempt in 5 seconds&#8221;</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="mso-tab-count: 2;"><span style="font-size: 10pt;">            </span></span></span><span style="font-size: 10pt;"><span>Start-Sleep </span><em><span>-Seconds</span></em></span><span><span style="font-size: 10pt;"> 5</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-indent: 0.5in; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;">}</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-indent: 0.5in; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span style="color: #000000;"><span><span style="font-size: 10pt;">$retryCount</span></span><span><span style="font-size: 10pt;">&#8211;</span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"><span><span style="font-size: 10pt; color: #000000; font-family: Consolas;">}</span></span></p>
<h2></h2>
<h2>Conclusion</h2>
<p>In conclusion here are the lessons learned from this task:</p>
<ol>
<li>Get-VIAccount requires to specify the domain alias to Domain parameter</li>
<li>Get-VIAccount limits the results to 5000</li>
<li>Sometimes Get-VIAccount fails to obtain domain users immediately after a VMhost is joined to a domain.</li>
</ol>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bgcolor="#c0c0c0">
<tbody>
<tr>
<td valign="top" width="100%">
<h3><a href="http://blogs.vmware.com/vipowershell/files/2013/04/image.png"><img style="background-image: none; float: left; padding-top: 0px; padding-left: 0px; margin: 0px 10px 0px 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/04/image_thumb.png" alt="image" width="110" height="145" align="left" border="0" /></a>This post was created by Dimitar Milov…</h3>
<p>Dimitar joined VMware and PowerCLI team in the beginning of 2011. He is member of the quality engineering part of the team and his main role is the functional verification of the vSphere, vCloud and License PowerCLI components.</p>
<p>As all members of the team he is working to deliver a good and valuable product. He is also working to improve all processes and tools involved in product development and validation.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vmware.com/vipowershell/2013/04/joining-esxi-hosts-to-a-domain-and-granting-permissions-with-powercli.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>VDS Export/Import with PowerCLI</title>
		<link>http://blogs.vmware.com/vipowershell/2013/03/vds-exportimport-with-powercli.html</link>
		<comments>http://blogs.vmware.com/vipowershell/2013/03/vds-exportimport-with-powercli.html#comments</comments>
		<pubDate>Fri, 29 Mar 2013 21:06:10 +0000</pubDate>
		<dc:creator>Alan Renouf</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">https://blogs.vmware.com/vipowershell/?p=1454</guid>
		<description><![CDATA[One of the great new features introduced in vSphere 5.1 was the ability to export and import the configuration of your vSphere Distributed Switch (VDS) and port groups to a file. This gives you a quick restore method in case &#8230; <a href="http://blogs.vmware.com/vipowershell/2013/03/vds-exportimport-with-powercli.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the great new features introduced in vSphere 5.1 was the ability to export and import the configuration of your vSphere Distributed Switch (VDS) and port groups to a file.</p>
<p>This gives you a quick restore method in case of issues or misconfigurations and also allows you to copy the entire VDS or port group configuration to a new VDS.  This feature is detailed by <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=2034602" target="_blank">this VMware KB</a> and is available via the vSphere Web Client, below you can see how we would do this via the web client:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/image10.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/03/image_thumb10.png" alt="image" width="510" height="480" border="0" /></a></p>
<h2>Exporting the configuration with PowerCLI</h2>
<p>With the introduction of the VDS cmdlets in PowerCLI 5.1 R2 we can also automate this process using the Export-VDSwitch and</p>
<p><span id="more-1454"></span></p>
<p>Export-VDPortGroup cmdlets, the following examples show how we might do this:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML4564272.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="SNAGHTML4564272" src="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML4564272_thumb.png" alt="SNAGHTML4564272" width="640" height="346" border="0" /></a></p>
<p>We can also choose to backup each port group configuration individually, the following example shows how to do this for a single port group:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML45b9f51.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="SNAGHTML45b9f51" src="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML45b9f51_thumb.png" alt="SNAGHTML45b9f51" width="640" height="391" border="0" /></a></p>
<p>But what if we wanted to back up all our port groups for that VDS individually, we can easily achieve this with the following:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML4602062.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="SNAGHTML4602062" src="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML4602062_thumb.png" alt="SNAGHTML4602062" width="640" height="391" border="0" /></a></p>
<p>The code used for this example is as follows:</p>
<p><span style="font-family: Consolas;">Get-VDSwitch -Name VDS-01 | Get-VDPortgroup | Foreach {<br />
Export-VDPortGroup -VDPortGroup $_ -Description &#8220;Backup of $($_.Name) PG&#8221; -Destination &#8220;C:\Backups\$($_.Name).Zip&#8221;<br />
}</span></p>
<h2>Importing the configuration with PowerCLI</h2>
<p>Now we have the exported configuration the next step is to look at how we could import these files again back into vCenter if an issue happened.  Of course each file could be imported from the vSphere web client individually but this post will show you how to do this with PowerCLI.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/image11.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/03/image_thumb11.png" alt="image" width="553" height="656" border="0" /></a></p>
<p>The code used in this example is as follows:</p>
<p><span style="font-family: Consolas;">Get-ChildItem &#8220;C:\Backups\PG&#8221; | Foreach {<br />
New-VDPortgroup -VDSwitch NewVDS -Name &#8220;New$($_.BaseName)&#8221; -BackupPath $_.FullName<br />
}</span></p>
<p>As you can see from the below, we now have two DVS which have the same configuration:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/image12.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/03/image_thumb12.png" alt="image" width="287" height="297" border="0" /></a></p>
<h2>Conclusion</h2>
<p>Backing up the VDS and port group configuration can not only give you a backup in case of emergency but can also be useful for creating new switches with the same configuration, one use case for example is moving the VDS configuration between vCenters, like test &amp; dev to Production.  The above examples show you how to automate this process with PowerCLI.</p>
<p>Don’t forget, the backup script could easily be scheduled to export on a weekly basis so that you have the latest configuration and multiple points in time to go back to.</p>
<p>Check out other new features in PowerCLI 5.1 R2 <a href="http://blogs.vmware.com/vipowershell/2013/02/powercli-5-1-release-2-now-available.html" target="_blank">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vmware.com/vipowershell/2013/03/vds-exportimport-with-powercli.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PowerCLI Lab Online – Sign up now for the public beta</title>
		<link>http://blogs.vmware.com/vipowershell/2013/03/powercli-lab-online-sign-up-now-for-the-public-beta.html</link>
		<comments>http://blogs.vmware.com/vipowershell/2013/03/powercli-lab-online-sign-up-now-for-the-public-beta.html#comments</comments>
		<pubDate>Mon, 25 Mar 2013 17:12:04 +0000</pubDate>
		<dc:creator>Alan Renouf</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[VMworld]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">https://blogs.vmware.com/vipowershell/?p=1429</guid>
		<description><![CDATA[If you were at VMworld in 2012 you may have attended the Hands on Labs (HOL), this is normally one of the most popular areas at VMworld as it’s a time when people can use the applications they don’t currently &#8230; <a href="http://blogs.vmware.com/vipowershell/2013/03/powercli-lab-online-sign-up-now-for-the-public-beta.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you were at VMworld in 2012 you may have attended the Hands on Labs (HOL), this is normally one of the most popular areas at VMworld as it’s a time when people can use the applications they don’t currently have installed in their own environments, they can use a virtual environment to follow instructions and see how the applications really work.</p>
<p>One of the most popular labs at VMworld is always the PowerCLI Lab, this was no exception in 2012, every year the PowerCLI team does a great job of adding new features to the latest version of PowerCLI and this is always a great way to check those features out in a test environment.</p>
<p>There has always been one issue with the HOL though, once you leave VMware you say goodbye to the HOL as access was previously at the event only….. Until Now.</p>
<p>There is now a public beta of the HOL Online, this gives you access to a number of different HOL Online for you to take at your own leisure and sat at the comfort of your own desk.</p>
<h2>How do I sign up?</h2>
<p>To sign up simply go to <a href="http://hol.vmware.com">http://hol.vmware.com</a> and click on the link as highlighted below:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/image2.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/03/image_thumb2.png" alt="image" width="727" height="536" border="0" /></a></p>
<p>Once you have filled out a few questions you will need to wait for your account to be activated (I have been assured this will be fairly quick).  Once activated you will be able to click on the “VMware Hands-on Labs Online” link as above and access a number of different labs, complete with their own isolated environment and full step by step documentation to run through the lab chosen.</p>
<h2>How do I find the PowerCLI Lab?</h2>
<p>Once you have gained access to the HOL and signed in use the left hand menu to select “Cloud Infrastructure”</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/image3.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/03/image_thumb3.png" alt="image" width="233" height="462" border="0" /></a></p>
<p>Now scroll down the list on the right until you see the PowerCLI Lab, then click Enroll.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/image7.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/03/image_thumb7.png" alt="image" width="640" height="133" border="0" /></a></p>
<p>Once you have done this the selected Lab will be added to “My Enrollments” where you will be able to click the “Start this LAB” button to launch the lab as below:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/image8.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/03/image_thumb8.png" alt="image" width="640" height="210" border="0" /></a></p>
<p>The LAB will now start and you will have access as seen below:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/image9.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/03/image_thumb9.png" alt="image" width="640" height="372" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vmware.com/vipowershell/2013/03/powercli-lab-online-sign-up-now-for-the-public-beta.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerScripting Podcast–What’s new in PowerCLI 5.1 R2</title>
		<link>http://blogs.vmware.com/vipowershell/2013/03/powerscripting-podcastwhats-new-in-powercli-5-1-r2.html</link>
		<comments>http://blogs.vmware.com/vipowershell/2013/03/powerscripting-podcastwhats-new-in-powercli-5-1-r2.html#comments</comments>
		<pubDate>Fri, 22 Mar 2013 17:28:26 +0000</pubDate>
		<dc:creator>Alan Renouf</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">https://blogs.vmware.com/vipowershell/?p=1414</guid>
		<description><![CDATA[If you enjoy podcasts or have a long commute and don’t mind listening to people talk about PowerShell then I can highly recommend the PowerScripting Podcast, they have some great PowerShell information every week and if you have not listened &#8230; <a href="http://blogs.vmware.com/vipowershell/2013/03/powerscripting-podcastwhats-new-in-powercli-5-1-r2.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img style="float: left; display: inline;" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRTIzNLwMH10iLLHT-RPZbU-897LsUyZgqGzjg9jnct0uj2xg_-" alt="" align="left" />If you enjoy podcasts or have a long commute and don’t mind listening to people talk about PowerShell then I can highly recommend the PowerScripting Podcast, they have some great PowerShell information every week and if you have not listened before then you already have 219 podcasts to catch up on!</p>
<p>Recently I had the pleasure of being interviewed on the PowerScripting Podcast by Hal and Jonathan, we talked about what was new with PowerCLI, what was cool in the world of PowerShell and also what I would do on a trip to Mars (I know – Random!).</p>
<p>For more information and ways to download the podcast visit their site here: <a title="http://powerscripting.wordpress.com/2013/03/13/episode-219-alan-renouf-from-vmware-on-powercli/" href="http://powerscripting.wordpress.com/2013/03/13/episode-219-alan-renouf-from-vmware-on-powercli/">http://powerscripting.wordpress.com/2013/03/13/episode-219-alan-renouf-from-vmware-on-powercli/</a></p>
<p>For more information on what&#8217;s new in PowerCLI 5.1 R2 make sure you check out this blog post: <a title="http://blogs.vmware.com/vipowershell/2013/02/powercli-5-1-release-2-now-available.html" href="http://blogs.vmware.com/vipowershell/2013/02/powercli-5-1-release-2-now-available.html">http://blogs.vmware.com/vipowershell/2013/02/powercli-5-1-release-2-now-available.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vmware.com/vipowershell/2013/03/powerscripting-podcastwhats-new-in-powercli-5-1-r2.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Retrieving vCloud Director VM Hard Disk size</title>
		<link>http://blogs.vmware.com/vipowershell/2013/03/retrieving-vcloud-director-vm-hard-disk-size.html</link>
		<comments>http://blogs.vmware.com/vipowershell/2013/03/retrieving-vcloud-director-vm-hard-disk-size.html#comments</comments>
		<pubDate>Tue, 19 Mar 2013 22:06:40 +0000</pubDate>
		<dc:creator>Alan Renouf</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[vCloud]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">https://blogs.vmware.com/vipowershell/?p=1405</guid>
		<description><![CDATA[I was asked recently if we were able to retrieve the disk space of a VM in vCloud Director through PowerCLI, on checking this I found that it is not currently part of the CIVM object and also there is &#8230; <a href="http://blogs.vmware.com/vipowershell/2013/03/retrieving-vcloud-director-vm-hard-disk-size.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was asked recently if we were able to retrieve the disk space of a VM in vCloud Director through PowerCLI, on checking this I found that it is not currently part of the CIVM object and also there is currently no Get-HardDisk cmdlet equivalent like in the vSphere snapin.</p>
<p>After looking through the <a href="http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/index.html" target="_blank">REST API Reference Documentation</a> –&gt; User Operations I found an entry for the VM VirtualHardwareSection  and specifically the disks which can be found as can be seen here: <span style="color: #000000;"><a href="http://pubs.vmware.com/vcd-51/index.jsp?topic=%2Fcom.vmware.vcloud.api.reference.doc_51%2Fdoc%2Foperations%2FGET-DisksRasdItemsList.html" target="_blank">GET /vApp/{id}/virtualHardwareSection/disks</a></span></p>
<p>The virtualhardwaresection is easily accessed via PowerCLI using the extensiondata property which allows access to the back end API, I could then find my disk properties by filtering on the description of Hard Disk as in the example below:</p>
<p>(Get-VM MyCloudVM).ExtensionData.getvirtualhardwaresection().Item | Where { $_.Description -like &#8220;Hard Disk&#8221;}</p>
<p>Now I had the hard disk I noticed that part of the information was the capacity as highlighted below:<a href="http://blogs.vmware.com/vipowershell/files/2013/03/image.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/03/image_thumb.png" alt="image" width="1024" height="358" border="0" /></a></p>
<p>With this information I could then find the capacity of the disk and add the information I needed into more of a friendly PowerShell property to the Hard Disk object.</p>
<p>So tying this all back together we could easily use the .ExtensionData reference to create our own Advanced PowerShell function to return the hard disk information for any CIVM.</p>
<h2>Example</h2>
<p>The following shows an example of how to use this new function and the output, this of course can also be used to export into CSV/HTML/Text or any other format PowerShell can be used with, it is also great for reporting on where the disk space in your cloud is being used!</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/image1.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="http://blogs.vmware.com/vipowershell/files/2013/03/image_thumb1.png" alt="image" width="668" height="391" border="0" /></a></p>
<h2>The Code</h2>
<p><span style="font-family: Consolas;">Function Get-CIVMHardDisk {<br />
Param (<br />
[Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)]<br />
$CIVM<br />
)<br />
Process {<br />
$AllHDD = $CIVM.ExtensionData.getvirtualhardwaresection().Item | Where { $_.Description -like &#8220;Hard Disk&#8221;}<br />
$HDInfo = @()<br />
Foreach ($HD in $AllHDD) {<br />
$HD | Add-Member -MemberType NoteProperty -Name &#8220;Capacity&#8221; -Value $HD.HostResource[0].AnyAttr[0].&#8221;#text&#8221;<br />
$HD | Add-Member -MemberType NoteProperty -Name &#8220;VMName&#8221; -Value $CIVM.Name<br />
$HDInfo += $HD<br />
}<br />
$HDInfo<br />
}</p>
<p>}</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vmware.com/vipowershell/2013/03/retrieving-vcloud-director-vm-hard-disk-size.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Back to Basics: Connecting to vCenter or a vSphere Host</title>
		<link>http://blogs.vmware.com/vipowershell/2013/03/back-to-basics-connecting-to-vcenter-or-a-vsphere-host.html</link>
		<comments>http://blogs.vmware.com/vipowershell/2013/03/back-to-basics-connecting-to-vcenter-or-a-vsphere-host.html#comments</comments>
		<pubDate>Tue, 05 Mar 2013 21:26:08 +0000</pubDate>
		<dc:creator>Alan Renouf</dc:creator>
				<category><![CDATA[BackToBasic]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[vCloud]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">https://blogs.vmware.com/vipowershell/?p=1385</guid>
		<description><![CDATA[Following my previous post which took you through the install of PowerCLI I thought it was time to add another back to basics (B2B) post and show how to take the first step in using PowerCLI… Connecting to your vCenter &#8230; <a href="http://blogs.vmware.com/vipowershell/2013/03/back-to-basics-connecting-to-vcenter-or-a-vsphere-host.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Following my <a href="http://blogs.vmware.com/vipowershell/2011/06/back-to-basics-part-1-installing-powercli.html">previous post</a> which took you through the install of PowerCLI I thought it was time to add another back to basics (B2B) post and show how to take the first step in using PowerCLI… Connecting to your vCenter or vSphere host.</p>
<p>Yes, PowerCLI can be used to connect to both vCenter and also the vSphere host independently, of course not all the cmdlets will be relevant if you connect to just the host but still, this can be useful during the initial setup or automated deployments of the complete infrastructure.</p>
<h2>How to connect</h2>
<p>If you are connecting to either a vCenter server or a vSphere Host the cmdlet is the same, you can use the Connect-VIServer cmdlet to connect to both of these (even at the same time), lets take a look at an example:</p>
<p><span style="font-family: consolas">C:\PS&gt;Connect-VIServer -Server vcenter01 -User admin -Password pass</span></p>
<p>In the above example you can see we are connecting to our vCenter server called “vcenter01” with a username and password to gain access to the vCenter server, we did not specify a protocol or port, by default HTTPS and port 443 is assumed which is the same as the vSphere Client or Web Client, unless you specify a –port or –protocol parameter for the cmdlet.</p>
<h2>Credentials</h2>
<p>In the example above we used the –User and –Password parameters to pass through the credentials but this might not always be what you want to do, especially as PowerShell files are plain text!&nbsp; There are multiple ways in which we can specify the credentials or store the credentials, its really up to you which you use and which is best suited for your situation.</p>
<h3></h3>
<p><span id="more-1385"></span><br />
<h3>Pass-through</h3>
<p><span style="font-family: consolas">C:\PS&gt;Connect-VIServer -Server vcenter01</span></p>
<p>If we do not enter a username or password parameter and just use the cmdlet like the above example then the credentials of the current user are passed through to the vCenter or vSphere host and used to try and authenticate the connection.&nbsp; This is great if your environment is setup in the same domain as your vCenter box or your specific user account has been given access to vCenter or the host.&nbsp; One thing to watch out for here is this may work whilst you are logged in but if you have a script which runs as a scheduled task or is to be run as another user then you will need to make sure the account running the scheduled task or as the other user also has vCenter access.</p>
<p>As a note, the Connect-VIServer cmdlet first tries Kerberos authentication, if this does not work it then tries NTLM authentication.<br />Kerberos should work for Windows based vCenters, the vCenter Virtual Appliance (VCVA) and ESXi when they are connected to Active Directory.</p>
<p>NTLM works only for the Windows vCenter.</p>
<p>To monitor the authentication and diagnose which is being used we can use the –verbose parameter with Connect-VIServer as below:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML97c62e81.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SNAGHTML97c62e8" border="0" alt="SNAGHTML97c62e8" src="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML97c62e8_thumb1.png" width="677" height="225"></a></p>
<p>In the above case my pass-through authentication failed and I was prompted for credentials to the host.</p>
<h3>VICredentialStore</h3>
<p>With PowerCLI we have the ability to store credentials for connections to different vCenter Servers or vSphere hosts and it can&nbsp; also be used to store credentials for vCloud Director when using the Connect-CIServer cmdlet, this feature is called the VICredentialStore, this becomes useful when we want to connect but do not always want to specify the username and password to use, the cmdlets we provide are listed below:</p>
<p><span style="font-family: consolas">Get-VICredentialStoreItem</span>&nbsp;&nbsp;&nbsp; This cmdlet retrieves the credential store items available on a vCenter Server system.<br /><span style="font-family: consolas">New-VICredentialStoreItem</span>&nbsp;&nbsp;&nbsp; This cmdlet creates a new entry in the credential store.<br /><span style="font-family: consolas">Remove-VICredentialStoreItem</span>&nbsp;&nbsp;&nbsp; This cmdlet removes the specified credential store items.</p>
<p>The <span style="font-family: consolas">New-VICredentialStoreItem</span> cmdlet creates a new entry in the credential store and encrypts the password. If there is an existing entry for the specified host and user, it is overwritten.&nbsp; If the credential store file does not exist, it is created (along with its directory if needed).</p>
<p>If no file is specified, the item is created in the default credential store file %APPDATA%\VMware\credstore\vicredentials.xml.</p>
<p>Credential store items for vCloud Director servers must contain user name and organization in the following format: user_name:organization_name, where both names are lower-cased.</p>
<p>An example of this command is shown below:</p>
<p>C:\PS&gt;New-VICredentialStoreItem -Host vCenter01 -User Admin -Password pass</p>
<p>Once this has been added to the VICredentialStore we are able to connect to vcenter01 without using the –User or –Password parameters.</p>
<p>A key thing to remember when using the Connect-VIServer cmdlet is that in a case where we did not provide a username/password parameter we first check the VICredentialStore. If the credential store doesn’t have the connection information for the requested server we try passthrough authentication. In a case where the credential store does contains connection information, but we fail to connect for some other reason (e.g. network connectivity) we don’t try pass-through and just show the error.</p>
<p>If a username/password parameter is used in the cmdlet then the VICredentialStore is ignored and the parameters are used for credentials.</p>
<h2>Recently Connected Servers</h2>
<p>Another nice parameter in the Connect-VIServer cmdlet is the –Menu parameter.&nbsp; If you use the –Menu parameter it Indicates that you want to select a connection server from a list of recently connected servers. If Menu is set to $true, the cmdlet retrieves a list of the last visited servers and enters a nested command prompt, so that you can select a server from the list.</p>
<p>An example of this is shown below, this can be great if you connect to multiple vCenter servers as you don’t always have to remember or retype the names!</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML58ff5d0.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SNAGHTML58ff5d0" border="0" alt="SNAGHTML58ff5d0" src="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML58ff5d0_thumb.png" width="677" height="342"></a></p>
<h2>Connection Information</h2>
<p>Now you are connected to the vCenter you can access a global variable which stores the connection information, this is the $defaultVIServer variable and contains the connection information:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML980a0b3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SNAGHTML980a0b3" border="0" alt="SNAGHTML980a0b3" src="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML980a0b3_thumb.png" width="640" height="323"></a></p>
<p>If you connect to more than one vCenter or vSphere Host you will see that a new variable is created called $defaultVIServer<font color="#ff0000"><strong>s </strong></font><font color="#000000">this stores the connection information for all connected entities where as the $defaultVIServer will only be the most recent connection.</font></p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML9876308.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SNAGHTML9876308" border="0" alt="SNAGHTML9876308" src="http://blogs.vmware.com/vipowershell/files/2013/03/SNAGHTML9876308_thumb.png" width="677" height="156"></a></p>
<p><font color="#000000">These variables can be used to check your connection has been successful and also used for further reference later on in our scripts.</font></p>
<p>Now you have learned how to connect to your vCenter or vSphere host and a few more tricks why not start trying out some of the other cmdlets!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vmware.com/vipowershell/2013/03/back-to-basics-connecting-to-vcenter-or-a-vsphere-host.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerCLI 5.1 Release 2 Now Available</title>
		<link>http://blogs.vmware.com/vipowershell/2013/02/powercli-5-1-release-2-now-available.html</link>
		<comments>http://blogs.vmware.com/vipowershell/2013/02/powercli-5-1-release-2-now-available.html#comments</comments>
		<pubDate>Mon, 11 Feb 2013 17:02:02 +0000</pubDate>
		<dc:creator>Alan Renouf</dc:creator>
				<category><![CDATA[vCenter]]></category>
		<category><![CDATA[vCloud]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">https://blogs.vmware.com/vipowershell/?p=1363</guid>
		<description><![CDATA[PowerCLI 5.1 Release 2 has now been released and can be downloaded here.  As always you will find some great new features, bug fixes and enhancements which make PowerCLI even better than before… I know its hard to believe but &#8230; <a href="http://blogs.vmware.com/vipowershell/2013/02/powercli-5-1-release-2-now-available.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>PowerCLI 5.1 Release 2 has now been released and can be <a href="http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli?view=overview" target="_blank">downloaded here</a>.  As always you will find some great new features, bug fixes and enhancements which make PowerCLI even better than before… I know its hard to believe but its true.</p>
<h2>VDS Cmdlets</h2>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/02/image1.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; float: right; padding-top: 0px; border-width: 0px;" title="PowerCLI Snapins" src="http://blogs.vmware.com/vipowershell/files/2013/02/image_thumb1.png" alt="PowerCLI Snapins" width="270" height="299" align="right" border="0" /></a>Whenever I would ask the question at VMUG’s or VMWorld, “What would you like to see next from PowerCLI” I would always get the same answer “Support for Virtual Distributed Switches!”.</p>
<p>Previously there has been a <a href="http://labs.vmware.com/flings/vdspowercli" target="_blank">fling</a> available and also some <a href="http://www.lucd.info/tag/dvswitch/" target="_blank">work created</a> by community member “Luc Dekens” to use VDS, this was a great start but in some cases was not a sustainable solution as it was either not supported or more complicated to maintain or use.</p>
<p>I am now pleased to tell you that PowerCLI has a new snapin, this snapin is called VMware.VimAutomation.VDS and is for managing Virtual Distributed Switches.</p>
<p>Introduced are 14 new cmdlets which will allow you to perform actions against your VDS configuration, we can use the <strong>Get-VdsCommand</strong> cmdlet to list the new cmdlets.</p>
<p>An overview of these are below:</p>
<table style="border-bottom-style: none; border-collapse: collapse;" width="700" border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col style="width: 212pt; mso-width-source: userset; mso-width-alt: 10349;" width="283" />
<col style="width: 512pt; mso-width-source: userset; mso-width-alt: 24978;" width="683" /></colgroup>
<tbody>
<tr style="height: 15pt;">
<td class="xl67" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: black; vertical-align: bottom; padding-top: 1px; mso-pattern: black none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" width="282" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #ffffff;"><strong>Cmdlet Name</strong></span></span></td>
<td class="xl68" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: black; vertical-align: bottom; padding-top: 1px; mso-pattern: black none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" width="682"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #ffffff;"><strong>Cmdlet description</strong></span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Add-VDSwitchPhysicalNetworkAdapter</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet adds host physical network adapters to a distributed switch.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Add-VDSwitchVMHost</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet adds hosts to the specified distributed switch.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Export-VDPortGroup</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet exports the configuration of a specified distributed port group to a specified .zip file.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Export-VDSwitch</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet exports the configuration of a specified vSphere distributed switch to a .zip file.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Get-VDPortgroup</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet retrieves distributed port groups.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Get-VDSwitch</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet retrieves vSphere distributed switches.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">New-VDPortgroup</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet creates distributed port groups.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">New-VDSwitch</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet creates vSphere distributed switches.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Remove-VDPortGroup</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet removes distributed port groups.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Remove-VDSwitch</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet removes vSphere distributed switches.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Remove-VDSwitchPhysicalNetworkAdapter</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet removes host physical network adapters from the distributed switches they are connected to.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Remove-VDSwitchVMHost</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet removes hosts from the specified distributed switches.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl65" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Set-VDPortgroup</span></span></td>
<td class="xl66" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; background: #d9d9d9; vertical-align: bottom; padding-top: 1px; mso-pattern: #d9d9d9 none; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet modifies the configuration of distributed port groups.</span></span></td>
</tr>
<tr style="height: 15pt;">
<td class="xl69" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;" height="20"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">Set-VDSwitch</span></span></td>
<td class="xl70" style="padding-bottom: 0px; padding-left: 1px; padding-right: 1px; vertical-align: bottom; padding-top: 1px; text-underline-style: none; text-line-through: none; border: windowtext 0.5pt solid;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;">This cmdlet modifies the configuration of vSphere distributed switches.</span></span></td>
</tr>
</tbody>
</table>
<p>Remember each of these cmdlets has help built in, to access the help including examples of how you might use these cmdlets use the following:</p>
<p><span style="font-family: Consolas; font-size: small;">Get-Help <em>cmdletname</em> –full</span></p>
<h2>PowerShell v3 Support</h2>
<p>As well as the new cmdlets for working with Distributed switches and all the other great enhancements in PowerCLI 5.1 Release 2 we made sure we listened to our customers and with the release of PowerShell version 3 it seams that a lot of people are already making use or planning to install PowerShell v3.</p>
<p>You will be happy to know that PowerCLI now supports PowerShell v3, this not only gives you support from VMware but also we are now able to take advantage of some of the great enhancements which PowerShell v3 brings.</p>
<h3>Some PowerShell v3 examples…</h3>
<p>Simplified Syntax… Making PowerShell and therefore PowerCLI easier to read and quicker to type we can use simplified syntax to give us even more English like statements, before we would have needed to use the {} brackets to compare a property, now we are able to type it the same way we would think it…</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/02/SNAGHTML26e15701_thumb3.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="SNAGHTML26e15701_thumb3" src="http://blogs.vmware.com/vipowershell/files/2013/02/SNAGHTML26e15701_thumb3_thumb.png" alt="SNAGHTML26e15701_thumb3" width="677" height="342" border="0" /></a><em></em></p>
<p><em>The above simple example shows all virtual machines which are powered on.</em></p>
<h2>vCloud Director 5.1 Support</h2>
<p>With PowerCLI 5.1 R2 we have also added support for vCloud Director 5.1, you can now automate the latest version of vCloud director using both PowerCLI and PowerCLI for tenants in a vCloud Director 5.1 environment.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/02/image_thumb2.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image_thumb2" src="http://blogs.vmware.com/vipowershell/files/2013/02/image_thumb2_thumb.png" alt="image_thumb2" width="667" height="391" border="0" /></a></p>
<ul>
<li>
<h2>Download</h2>
<p>Don’t delay, you can <a href="http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli?view=overview" target="_blank">now download PowerCLI 5.1 Release 2 for admins and tenants here</a> and continue the automation of your VMware environment, also check out the change log and online cmdlet reference for more information.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vmware.com/vipowershell/2013/02/powercli-5-1-release-2-now-available.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Let’s Make New-VIProperty Easier</title>
		<link>http://blogs.vmware.com/vipowershell/2013/01/lets-make-new-viproperty-easier.html</link>
		<comments>http://blogs.vmware.com/vipowershell/2013/01/lets-make-new-viproperty-easier.html#comments</comments>
		<pubDate>Tue, 29 Jan 2013 19:29:21 +0000</pubDate>
		<dc:creator>Alan Renouf</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Reporting]]></category>
		<category><![CDATA[PowerCLI]]></category>

		<guid isPermaLink="false">https://blogs.vmware.com/vipowershell/?p=1342</guid>
		<description><![CDATA[New-VIProperty is a powerful PowerCLI cmdlet and it has been a part of the product since PowerCLI version 4.1. Several releases later, we are under the impression that it is still not widely used. If you take a look around &#8230; <a href="http://blogs.vmware.com/vipowershell/2013/01/lets-make-new-viproperty-easier.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.vmware.com/support/developer/PowerCLI/PowerCLI41/html/New-VIProperty.html">New-VIProperty </a>is a powerful PowerCLI cmdlet and it has been a part of the product since PowerCLI version 4.1. Several releases later, we are under the impression that it is still not widely used. If you take a look around the community, it is easy to find scripts which will would be easier to understand and also work faster if they were refactored to use the New-VIProperty cmdlet.</p>
<p>This blog post is not about how New-VIProperty works. There are several great blog posts on the internet which already explain how the cmdlet works and what its benefits are. Some of them are:</p>
<ul>
<li>LucD’s blog: Introduction to New-VIProperty &#8211; <a href="http://www.lucd.info/2010/07/13/powercli-4-1-brings-the-new-viproperty-cmdlet/">http://www.lucd.info/2010/07/13/powercli-4-1-brings-the-new-viproperty-cmdlet/</a></li>
<li>Arnim van Lieshout’s blog: A great blog post about the performance of custom properties created with New-VIProperty &#8211; <a href="http://www.van-lieshout.com/2010/09/why-new-viproperty-matters/">http://www.van-lieshout.com/2010/09/why-new-viproperty-matters/</a></li>
<li>Jonathan Medd’s blog: A blog post about New-VIProperty and LucD’s VIProperty module &#8211; <a href="http://www.jonathanmedd.net/2011/08/using-powercli-viproperties-and-the-viproperty-module.html">http://www.jonathanmedd.net/2011/08/using-powercli-viproperties-and-the-viproperty-module.html</a></li>
<li>The PowerCLI blog: A blog post which explains in detail what happens under the hood of custom properties &#8211; <a href="http://blogs.vmware.com/vipowershell/2011/08/ability-to-customize-vi-objects.html">http://blogs.vmware.com/vipowershell/2011/08/ability-to-customize-vi-objects.html</a></li>
<li>LucD’s blog (again): A list of useful VI properties (downloadable as a PS module) <a href="http://www.lucd.info/viproperties/">http://www.lucd.info/viproperties/</a></li>
</ul>
<p>We understand that using New-VIProperty is not that easy. There are a lot of things that should be considered when you create a property – the name of the type you want to customize, the name of the API property, etc.</p>
<p>This blog post includes a PS module whose purpose is to make the use of New-VIProperty easier, <a href="http://communities.vmware.com/servlet/JiveServlet/download/21633-1-103022/VIProperyHelper.zip" target="_blank">the module can be downloaded from here</a>.</p>
<p>Once you import this module into your PowerCLI session, you will be able to:</p>
<ul>
<li>Benefit from tab-completion for the New-VIProperty cmdlet</li>
<li>Inspect which types are customizable with New-VIProperty</li>
<li>Inspect the properties of a particular customizable type in depth</li>
</ul>
<h3>Let’s take a look at the tab-completion feature</h3>
<p>We can start creating a new property by entering “New-VIProperty –ObjectType“. Then, if we press the Tab key, we will iterate through the valid values for the ObjectType parameter.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image002.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image002" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image002_thumb.jpg" alt="clip_image002" width="640" height="134" border="0" /></a></p>
<p>Of course, when we know the first letters of the type we want to customize, we can enter them before pressing the Tab key. In this case, pressing the Tab key will iterate only through the types whose names start with the provided letters.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image004.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image004" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image004_thumb.jpg" alt="clip_image004" width="627" height="108" border="0" /></a></p>
<p>In the screen above, pressing the Tab key will show types like VirtualMachine, VirtualPortgroup, VirtualSwitch, etc.</p>
<p>If we are creating a value-based property, after the type has been defined, we should specify the API property with the –ValueFromExtensionProperty parameter. Now this is much easier using tab-completion.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image006.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image006" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image006_thumb.jpg" alt="clip_image006" width="627" height="131" border="0" /></a></p>
<p>So the type is VirtualMachine, and let’s say we want to add ToolsVersion. It is part of the Guest API property. So we can just enter “G” and then press Tab key. This time the tab-completion feature will search for all properties starting with “G” within the VirtualMachine backing API type. The first match is “Guest”.</p>
<p>After that we should add a dot and start pressing Tab until the desired property appears.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image008.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image008" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image008_thumb.jpg" alt="clip_image008" width="627" height="131" border="0" /></a></p>
<p>The Guest property has several sub-properties and after several hits on the Tab key we will reach the “ToolsVersion” property. The only thing left to do is give our new property a name. We will do this manually.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image010.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image010" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image010_thumb.jpg" alt="clip_image010" width="627" height="131" border="0" /></a></p>
<p>Tab-completion also works for the –BasedOnExtensionProperty parameter when you are creating a script-based property.</p>
<h3>The second enhancement is the ability to retrieve the list of customizable types</h3>
<p>The provided PS module exports the <strong>Get-VIPropertyValidTypeNames function</strong>. By default, it returns the complete list of types which we can customize using New-VIProperty.</p>
<p>Each type is represented by a PSObject with the following properties:</p>
<ul>
<li>TypeName – represents the string that New-VIProperty accepts through the ObjectType parameter</li>
<li>IsManaged – indicates whether the backing API type is managed or not. For more information about managed and data object types, see the vSphere API SDK documentation</li>
<li>VimTypes &#8211; a list of the backing API types. Knowing which is the backing type of a cmdlet type could be useful; for example, we can refer to the vSphere API SDK documentation for a more detailed description of the API type.</li>
</ul>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image012.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image012" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image012_thumb.jpg" alt="clip_image012" width="627" height="378" border="0" /></a></p>
<p>The function provides three filter parameters which let you reduce the list of types. Run “Get-Help Get-VIPropertyValidTypeNames” for more information.</p>
<h3>The last enhancement is another function named Get-VIPropertyHelperObject.</h3>
<p>This function accepts the name of a customizable type and returns a helper PSObject which could be used for:</p>
<ul>
<li>Inspecting the backing API type</li>
<li>Searching API type properties by name</li>
<li>Creating VI properties easily</li>
</ul>
<p>Let’s see this in action. Let’s pass VMHost to the function and save the result in the $helper variable.</p>
<p>The structure of the helper object is based on the backing API object. It has the same set of properties, but their purpose is informative. The output of this object looks like this:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image014.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image014" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image014_thumb.jpg" alt="clip_image014" width="627" height="378" border="0" /></a></p>
<p>At the top we can see the cmdlet type –VMHost – and the backing API type – HostSystem.</p>
<p>The list of all API type properties follows. For each property, the type is also displayed.</p>
<p>A plus symbol in front of the property indicates that it has sub-properties and it is browsable. For example, if you write $helper.Config, you will see all the properties of Config.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image016.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image016" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image016_thumb.jpg" alt="clip_image016" width="627" height="378" border="0" /></a></p>
<p>The helper object also has a method named SearchProperties. It searches all properties and sub-properties by name.</p>
<p>Let’s assume that we want to add a property to all VMHosts which shows the vendor of the hardware box. We also know that there is a ‘Vendor’ property in the API object, but we are not sure where it is defined, so we can call $helper.SearchProperties(‘Vendor’).</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image018.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image018" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image018_thumb.jpg" alt="clip_image018" width="627" height="221" border="0" /></a></p>
<p>The output contains all properties whose names contain ‘Vendor’. The last one is the property that we’re looking for.</p>
<p>The next step is creating a property and this is really easy with the helper object. The only thing that we have to do is to call this line: $helper.Summary.Hardware.Vendor.CreateValueProperty()</p>
<p>The helper object provides an identical method for each property within the whole structure. This method creates a VI property using the New-VIProperty cmdlet.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image020.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image020" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image020_thumb.jpg" alt="clip_image020" width="627" height="221" border="0" /></a></p>
<p>We can see that the method first shows the New-VIProperty expression which will be executed. Below this line, you can see the result of running the New-VIProperty cmdlet.</p>
<p>Let’s see the result of our actions:</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image022.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image022" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image022_thumb.jpg" alt="clip_image022" width="627" height="220" border="0" /></a></p>
<p>This method is really useful for an interactive PowerCLI session, but what about if we want to create a VI property within a script. The helper object provides two methods named <strong>GetValuePropertyCreationCode </strong>and <strong>GetScriptPropertyCreationCode.</strong></p>
<p>Both methods build and return a New-VIProperty expression which you can copy, paste and modify in your script.</p>
<p><a href="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image024.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image024" src="http://blogs.vmware.com/vipowershell/files/2013/01/clip_image024_thumb.jpg" alt="clip_image024" width="627" height="153" border="0" /></a></p>
<p>Three of the methods have a parameter which accepts the name of the new VI property. If it is not specified (as it is not in the examples), a name will be selected automatically.</p>
<h3>Summary</h3>
<p>In conclusion, this module allows you to:</p>
<ul>
<li>Inspect API types easily and search their properties by name</li>
<li>Create VI properties or generate New-VIProperty expressions to use in a script</li>
<li>Retrieve the list of customizable types</li>
<li>Use tab-completion within the New-VIProperty cmdlet</li>
</ul>
<p>Finally, let’s see where New-VIProperty is applicable and why it is better to use:</p>
<ul>
<ul>
<li>If you have a Select expression using hash table syntax
<ul>
<li><em><span style="font-family: Consolas;">Get-X | Select-Object -Property Name,@{Name=&#8221;NestedPropertyName&#8221;;Expression={&lt;some expression over $_&gt;}}</span></em></li>
</ul>
</li>
<li>If your script needs data from the ExtensionData/View
<ul>
<li><span style="font-family: Consolas;">foreach ($vm in $vms) { ….. $foo = $vm.ExtensionData.foo …..}</span></li>
</ul>
</li>
<li>The code look better</li>
<li>The scripts are faster</li>
</ul>
</ul>
<h3>Download</h3>
<p><a href="http://communities.vmware.com/servlet/JiveServlet/download/21633-1-103022/VIProperyHelper.zip" target="_blank">Download the module from here</a> and import it into your session.</p>
<h3>What Next?</h3>
<p>If you find this module helpful or have any other comments on this feature we would love to hear them, the PowerCLI team at VMware constantly tries to make PowerCLI a better product and a product which is easy to use, let us know what you think of this and if you would like to see things like this backed into the release of PowerCLI.</p>
<p>&nbsp;</p>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bgcolor="#c0c0c0">
<tbody>
<tr>
<td valign="top" width="100%">
<h3><img style="margin: 0px 5px; display: inline; float: left;" title="image" src="http://blogs.vmware.com/tp/.a/6a00d8341c328153ef016768fb99eb970b-pi" alt="image" width="129" height="143" align="left" border="0" />This post was created by Vitali Baruh…</h3>
<p>Vitali joined VMware and PowerCLI team in the beginning of 2009. He is member of the quality engineering part of the team and his main role is the functional verification of the vSphere, vCloud and License PowerCLI components.</p>
<p>As all members of the team he is working to deliver a good and valuable product. He is also working to improve all processes and tools involved in product development and validation.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vmware.com/vipowershell/2013/01/lets-make-new-viproperty-easier.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PowerCLI 5.1 and the future</title>
		<link>http://blogs.vmware.com/vipowershell/2012/12/powercli-5-1-and-the-future.html</link>
		<comments>http://blogs.vmware.com/vipowershell/2012/12/powercli-5-1-and-the-future.html#comments</comments>
		<pubDate>Thu, 06 Dec 2012 22:59:53 +0000</pubDate>
		<dc:creator>Alan Renouf</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[vCloud]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">https://blogs.vmware.com/vipowershell/?p=1308</guid>
		<description><![CDATA[Recently I have had some questions from people using PowerCLI, these are mainly related to confusion around the 5.1 release of VMware products and the way that PowerCLI works so I wanted to use this blog post to answer some &#8230; <a href="http://blogs.vmware.com/vipowershell/2012/12/powercli-5-1-and-the-future.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I have had some questions from people using PowerCLI, these are mainly related to confusion around the 5.1 release of VMware products and the way that PowerCLI works so I wanted to use this blog post to answer some of these questions but also to confirm that the future for PowerCLI is bright.</p>
<p><strong>Q.&nbsp; “Does PowerCLI work with the vCenter Server Appliance?”<a href="http://blogs.vmware.com/vipowershell/files/2012/12/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.vmware.com/vipowershell/files/2012/12/image_thumb.png" width="317" height="395"></a></strong></p>
<p>A. Yes it does, PowerCLI uses the vCenter APIs, in fact the best place to install PowerCLI is the same place that you would use the vSphere Client from, this is normally the vSphere admins workstation or a windows machine used solely for scheduled tasks.&nbsp; PowerCLI connects to the vCenter APIs and therefore both Windows and the appliance versions of vCenter work with PowerCLI 5.1.</p>
<p><strong>Q. “Does PowerCLI work with the vSphere Web Client?”</strong></p>
<p>A.&nbsp; A common question and yet in reality you do not need the C# vSphere Client or the vSphere Web Client in order for PowerCLI to work, everything you need is inside the installer for PowerCLI, just install it (<a href="http://blogs.vmware.com/vipowershell/2011/06/back-to-basics-part-1-installing-powercli.html">instructions here</a>) and your set.</p>
<p><strong>Q. “With VMware releasing more and more Linux related appliances what does this mean for PowerCLI?”</strong></p>
<p>A. PowerCLI is one of VMware’s most successful and well loved automation and troubleshooting tools by vSphere and vCloud Director Admins, as I said in the answer to a previous question, it connects directly to the vSphere APIs, it doesn’t care what is hosting them.</p>
<p>Whilst I can not discuss the roadmap for PowerCLI I can certainly say its as strong as ever and we will continue to wow the users of PowerCLI with the latest features and updates.</p>
<p><strong>Q. “Does Onyx work with vSphere 5.1?”<a href="http://blogs.vmware.com/vipowershell/files/2012/12/image1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.vmware.com/vipowershell/files/2012/12/image_thumb1.png" width="219" height="508"></a></strong></p>
<p>A. For those of you who are not aware of what <a href="http://labs.vmware.com/flings/onyx" target="_blank">Onyx</a> is, it’s a <a href="http://labs.vmware.com/flings/onyx" target="_blank">VMware Fling</a> which sits in-between your vCenter and your vCenter Client, it intercepts the traffic and translates it into PowerShell code, not nicely formatted PowerCLI type cmdlets but still a great place to look if you need to find a way to do something quickly.</p>
<p>You hit play on the Onyx client and the fun begins, anything you do in the vSphere client from then on is captured and represented as code, and not just PowerShell code but also C#, vCO JavaScript and&nbsp; Raw SOAP messages.</p>
<p>So does it work with 5.1 ?&nbsp; Yes of course it does, but only when using the C# client, obviously the vSphere Web Client works differently and therefore Onyx is unable to capture the actions you take in the web client and turn them into code, as this is a fling I can not make any promises of if or when this will be updated to work with the web client but obviously the challenges are different.&nbsp; In the meantime make sure you use the C# client when you want to capture the code.</p>
<hr />
<p><strong>Hopefully this will help eliminate any questions about PowerCLI and how it works with 5.1 and the future, if you have any further questions please add a comment to this post and we will do our best to answer them.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vmware.com/vipowershell/2012/12/powercli-5-1-and-the-future.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.196 seconds. --><!-- Cached page generated by WP-Super-Cache on 2013-06-10 18:25:32 -->
