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

<channel>
	<title>Hypervisor.fr &#187; Get-EsxCli</title>
	<atom:link href="http://www.hypervisor.fr/?feed=rss2&#038;tag=get-esxcli" rel="self" type="application/rss+xml" />
	<link>http://www.hypervisor.fr</link>
	<description>French Bare-Metal weblog</description>
	<lastBuildDate>Wed, 26 Jun 2024 22:42:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Host.Local.ManageUserGroups = root</title>
		<link>http://www.hypervisor.fr/?p=6005</link>
		<comments>http://www.hypervisor.fr/?p=6005#comments</comments>
		<pubDate>Fri, 30 Jul 2021 14:16:51 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[esxcli]]></category>
		<category><![CDATA[Get-EsxCli]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[vCenter]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=6005</guid>
		<description><![CDATA[MAJ 11/01/2023 : William Lam vient de nous faire remarquer qu&#8217;il etait possible d&#8217;hardener vSphere 8 pour limiter cette &#8220;feature&#8221; ainsi que de limiter le shell aux user non root (dcui par exemple&#8230;)

By restricting ESXi Shell access for the vpxuser, you prevent attackers,  which can also be insiders who have access to vCenter Server the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 11/01/2023</span> : <a href="https://williamlam.com/2023/01/applying-additional-security-hardening-enhancements-in-esxi-8-0.html" target="_blank">William Lam vient de nous faire remarquer qu&#8217;il etait possible d&#8217;hardener vSphere 8 pour limiter cette &#8220;feature&#8221; ainsi que de limiter le shell aux user non root (dcui par exemple&#8230;)</a></em></p>
<blockquote>
<p style="text-align: justify;"><em>By restricting ESXi Shell access for the vpxuser, you prevent attackers,  which can also be insiders who have access to vCenter Server <strong>the  ability to just change the ESXi root password without knowing the  original password</strong>.</em></p>
</blockquote>
<p style="text-align: justify;">Après l’énorme succès de notre billet <a href="http://www.hypervisor.fr/?p=5655" target="_blank">Administrators = root</a> qui vous permet de reset le mot de passe root de vos ESX sans le connaître (si vous êtes admin du vCenter) grâce à Get-EsxCli, voici <a href="https://vdc-repo.vmware.com/vmwb-repository/dcr-public/790263bc-bd30-48f1-af12-ed36055d718b/e5f17bfc-ecba-40bf-a04f-376bbb11e811/vim.host.LocalAccountManager.html#updateUser" target="_blank">une nouvelle méthode utilisable depuis vSphere 6.7 U2</a> qui nécessite encore moins de droits :</p>
<blockquote><p>Updates a local user account using the parameters defined in the   <a href="https://vdc-repo.vmware.com/vmwb-repository/dcr-public/790263bc-bd30-48f1-af12-ed36055d718b/e5f17bfc-ecba-40bf-a04f-376bbb11e811/vim.host.LocalAccountManager.AccountSpecification.html" target="_blank">HostLocalAccountManagerAccountSpecification</a> data object type.</p></blockquote>
<blockquote><p>Required Privileges <a href="https://files.hypervisor.fr/img/HostLocalManageUserGroups.png" target="_blank">Host.Local.ManageUserGroups</a></p></blockquote>
<pre class="brush: powershell; title: ; notranslate">(Get-View (Get-VMHost|Get-View).ConfigManager.AccountManager).UpdateUser($(New-Object VMware.Vim.HostAccountSpec -Property @{id=&quot;root&quot;;password=&quot;VMw4re!&quot;}))</pre>
<p style="text-align: justify;">Attention, contrairement à la méthode Get-EsxCli, cette fois un petit event va vous trahir instantanément :</p>
<p style="text-align: justify;"><img class="aligncenter" src="https://files.hypervisor.fr/img/HostAccountSpec.png" alt="" width="517" height="324" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=6005</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VsanHostDecommissionMode en PowerCLI</title>
		<link>http://www.hypervisor.fr/?p=5581</link>
		<comments>http://www.hypervisor.fr/?p=5581#comments</comments>
		<pubDate>Sat, 08 Aug 2015 00:03:51 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[VSAN]]></category>
		<category><![CDATA[esxcli]]></category>
		<category><![CDATA[Get-EsxCli]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=5581</guid>
		<description><![CDATA[Pour les 7 ans d&#8217;Hypervisor.fr (si,si, c&#8217;est aujourd&#8217;hui) nous vous offrons un petit onliner pour mettre en maintenance un des nœuds de votre cluster VSAN en PowerCLI, dans la lignée de nos précédents posts &#8220;vSphere sans le webclient&#8221;.
Nous étions parti pour utiliser le script disponible sur VSANTeam.info mais il est malheureusement faux car il n&#8217;inclus pas l&#8217;objet [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Pour les 7 ans d&#8217;<strong>Hypervisor.fr</strong> (<a href="http://www.hypervisor.fr/?p=1" target="_blank">si,si, c&#8217;est aujourd&#8217;hui</a>) nous vous offrons un petit onliner pour <strong>mettre en maintenance un des nœuds de votre cluster VSAN en PowerCLI</strong>, dans la lignée de nos précédents posts &#8220;vSphere sans le webclient&#8221;.</p>
<p style="text-align: justify;">Nous étions parti pour utiliser le script disponible sur <a href="http://vsanteam.info/maintenance-mode-using-powercli/" target="_blank">VSANTeam.info</a> mais il est malheureusement faux car il n&#8217;inclus pas l&#8217;objet <a href="http://pubs.vmware.com/vsphere-60/topic/com.vmware.wssdk.apiref.doc/vim.vsan.host.DecommissionMode.ObjectAction.html" target="_blank">VsanHostDecommissionModeObjectAction</a> et donc <strong>le mode &#8220;ensureObjectAccessibility&#8221; est utilisé par défaut</strong>. Donc pour pouvoir utiliser le mode &#8220;evacuateAllData&#8221; ou &#8220;noAction&#8221; c&#8217;est comme ça qu&#8217;on fait :</p>
<pre class="brush: powershell; title: ; notranslate">Get-View -ViewType HostSystem -Filter @{&quot;Name&quot; = &quot;esx.vmware.com&quot; }|?{!$_.Runtime.InMaintenanceMode}|%{$_.EnterMaintenanceMode(0, $false, (new-object VMware.Vim.HostMaintenanceSpec -Property @{vsanMode=(new-object VMware.Vim.VsanHostDecommissionMode -Property @{objectAction=[VMware.Vim.VsanHostDecommissionModeObjectAction]::NoAction})}))}</pre>
<p>Sinon vous pouvez aussi le faire avec Get-EsxCli en vous inspirant <a href="http://www.virtuallyghetto.com/2014/07/quick-tip-steps-to-shutdownstartup-vsan-cluster-wvcenter-running-on-vsan-datastore.html" target="_blank">du post de William</a>.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://files.hypervisor.fr/img/vSAN.png" alt="" width="349" height="260" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=5581</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get-EsxCli de PowerCLI v5 supporte le &#8220;SSO&#8221;</title>
		<link>http://www.hypervisor.fr/?p=3947</link>
		<comments>http://www.hypervisor.fr/?p=3947#comments</comments>
		<pubDate>Mon, 16 Jul 2012 00:08:28 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[esxcli]]></category>
		<category><![CDATA[Get-EsxCli]]></category>
		<category><![CDATA[oneliner]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sso]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3947</guid>
		<description><![CDATA[Alors que nous scriptions le check du paramètre UNMAP des primitives VAAI avec la cmdlet Get-EsxCli, nous nous sommes aperçu par hasard que contrairement à celle de la v4 de PowerCLI cette cmdlet avait un paramètre &#8221;VMHost&#8221; en plus du paramètre &#8221;Server&#8221; déjà présente dans la v4. Sachant que cette cmdlet ne pouvait être exécutée que lors d&#8217;une session direct avec un (ou plusieurs) ESX lors son [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Alors que nous scriptions le check du paramètre <a href="http://kb.vmware.com/kb/2007427" target="_blank">UNMAP des primitives VAAI</a> avec <a href="http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-EsxCli.html" target="_blank">la cmdlet Get-EsxCli</a>, nous nous sommes aperçu par hasard que contrairement à celle de la v4 de PowerCLI cette cmdlet avait un paramètre &#8221;VMHost&#8221; en plus du paramètre &#8221;Server&#8221; déjà présente dans la v4. Sachant que cette cmdlet ne pouvait être exécutée que lors d&#8217;une session direct avec un (ou plusieurs) ESX <a href="http://www.hypervisor.fr/?p=2507" target="_blank">lors son apparition dans le PowerCLI 4.1 U1</a>, la présence du paramètre &#8221;VMHost&#8221; nous a paru plus que suspect.</p>
<p style="text-align: justify;">Et bien nous en a pris car cet indice nous a permis de découvrir (1 an plus tard&#8230;) que <strong>la cmdlet Get-EsxCli de PowerCLI 5+ ne nécessite pas de connections direct aux ESX</strong> (mais <a href="http://www.vmware.com/support/developer/PowerCLI/changelog.html#PowerCLI50" target="_blank">uniquement avec un vCenter 5+ comme en témoigne le changelog</a>) :</p>
<blockquote>
<p style="text-align: justify;">Added vCenter Server support for Get-EsxCli. (requires vCenter Server 5.0 or later)</p>
</blockquote>
<p style="text-align: justify;">Vous pouvez donc facilement vérifier l&#8217;état du paramètre UNMAP&#8230;</p>
<p style="text-align: justify;"><img class="aligncenter" src="http://files.hypervisor.fr/img/get-esxcli_v5/get-esxcli_sso_unmap.png" alt="" width="518" height="136" /></p>
<pre class="brush: powershell; title: ; notranslate">Get-VMHost|select Name, @{n=&quot;UNMAP&quot;;e={$(($_|Get-EsxCli).system.settings.advanced.list(&quot;/VMFS3/EnableBlockDelete&quot;)).IntValue}}</pre>
<p style="text-align: justify;">&#8230; Ou afficher la liste des claimrule (<a href="http://kb.vmware.com/kb/1009449" target="_blank">pratique pour masquer un path</a>)&#8230;</p>
<p style="text-align: justify;"><img class="aligncenter" src="http://files.hypervisor.fr/img/get-esxcli_v5/get-esxcli_sso_claimrules.png" alt="" width="518" height="398" /></p>
<pre class="brush: powershell; title: ; notranslate">Get-VMHost|%{&quot; &quot;;write-host -background white -foreground red $_.Name;($_|Get-EsxCli).storage.core.claimrule.list()|ft *}</pre>
<p style="text-align: justify;">&#8230; Ou encore modifier le paramètre &#8220;<a href="http://jpaul.me/?p=2492" target="_blank">IOOperationLimit</a>&#8221; des LUN configurées en roundrobin :</p>
<p style="text-align: justify;"><img class="aligncenter" src="http://files.hypervisor.fr/img/get-esxcli_v5/get-esxcli_sso_iops.png" alt="" width="518" height="1094" /></p>
<pre class="brush: powershell; title: ; notranslate">ForEach ($VMHost in Get-VMHost){&quot; &quot;;write-host -background white -foreground red $VMHost.Name;($VMHost|Get-EsxCli).storage.nmp.device.list()|?{$_.PathSelectionPolicy -match &quot;VMW_PSP_RR&quot;}|%{($VMHost|Get-EsxCli).storage.nmp.psp.roundrobin.deviceconfig.get($_.device)}}</pre>
<pre class="brush: powershell; title: ; notranslate">ForEach ($VMHost in Get-VMHost){&quot; &quot;;write-host -background white -foreground red $VMHost.Name;($VMHost|Get-EsxCli).storage.nmp.device.list()|?{$_.PathSelectionPolicy -match &quot;VMW_PSP_RR&quot;}|%{($VMHost|Get-EsxCli).storage.nmp.psp.roundrobin.deviceconfig.get($_.device)}|?{$_.IOOperationLimit -ne 1 -and $_.LimitType -ne &quot;iops&quot;}|%{($VMHost|Get-EsxCli).storage.nmp.psp.roundrobin.deviceconfig.set($null,$_.device,&quot;1&quot;,&quot;iops&quot;,$null)}}</pre>
<p>Moralité : RTFChangelog <img src='http://www.hypervisor.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3947</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
