Quantcast
Channel: VMware Communities : All Content - VMware PowerCLI
Viewing all 16717 articles
Browse latest View live

Adding esxi hostname as a column to get-vmhost | get-vmhostservice

$
0
0

I am using the command "get-vmhost | get-vmhostservice | where {$_.Key -eq "TSM"}" to see if I have ESXi Shell or SSH running on hosts. The output in get with PowerCLI is:

 

Key                  Label                          Policy     Running  Required

---                  -----                          ------     -------  --------

TSM                  ESXi Shell                     off        False    False

TSM                  ESXi Shell                     off        False    False

TSM                  ESXi Shell                     off        False    False

TSM                  ESXi Shell                     off        False    False

TSM                  ESXi Shell                     off        False    False

TSM                  ESXi Shell                     off        False    False

TSM                  ESXi Shell                     off        False    False

TSM                  ESXi Shell                     off        False    False

TSM                  ESXi Shell                     off        False    False

TSM                  ESXi Shell                     off        False    False

 

How do I add the ESXI hostname as a column in this output?


Clone Vapp Boot Options

$
0
0

Hi all, have a question on using powercli towards vSpahre 6.5 vapps.  

 

I have a MAster vApp with multiple VMs.

 

I am able to create a new vApp and create linked clones of VM's in the MAster App.

Now I want to set the boot priority an the new vApp the same as on the MAster vApp.

 

Anny suggestions on how to do this?

Already found out that I can read the vApp startup options via

$vapp = Get-VApp "MASTER_vApp"

$MastervApp= $vapp.ExtensionData.VAppConfig.EntityConfig

 

But I am not sure how to set these on the new vApp.  the name of a VM in the new vApp has a reference to the Master VM

 

any help welcome

 

Gert

trouble running Power NSX / PowerCLI on my MAC OS

$
0
0

Hi guys,

 

 

I am having trouble running Power NSX / PowerCLI on my mac.

I have appropriate versions, but keep getting these error messages.

 

 

Any ideas?

 

 

 

 

PS /Users/rdouglas> Connect-VIServer -server 192.168.10.10 -user administrator@vsphere.local

Connect-VIServer : The 'Connect-VIServer' command was found in the module 'VMware.VimAutomation.Core', but the module could

not be loaded. For more information, run 'Import-Module VMware.VimAutomation.Core'.

At line:1 char:1

+ Connect-VIServer -server 192.168.10.10 -user administrator@vsphere.lo ...

+ ~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (Connect-VIServer:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

 

 

PS /Users/rdouglas> Get-PSVersion

 

 

Major Minor Patch Label

----- ----- ----- -----

    6     0     0 alpha

 

 

 

 

PS /Users/rdouglas> Find-Module | Where{$_.Name -like "*PowerCLI*"}

 

 

Version    Name                                Repository           Description

-------    ----                                ----------           -----------

6.5.3.6... VMware.PowerCLI                     PSGallery            This Windows PowerShell module contains VMware.PowerCLI

1.0        DSC_PowerCLISnapShotCheck           PSGallery            This PowerCLI DSC Resource will check’s for configurat...

1.0.1      PowerCLITools                       PSGallery            PowerCLI Tools

1.0        PowerClippy                         PSGallery            Bringing back our friend Clippy, through the magic of ...

1.0        PowerCLI.SessionManager             PSGallery            Manage VMware sessions

0.4.2      Veeam.PowerCLI-Interactions         PSGallery            This PowerShell Module enables you to interact via VMw...

 

 

 

 

PS /Users/rdouglas> Find-Module | Where{$_.Name -like "*NSX*"}

 

 

Version    Name                                Repository           Description

-------    ----                                ----------           -----------

2.0.0.6... VMware.VimAutomation.Nsxt           PSGallery            This Windows PowerShell module contains PowerCLI NSXT ...

3.0.1054   PowerNSX                            PSGallery            PowerNSX is a PowerShell module that abstracts the VMw...

3.0.1235   TestNBPNSX                          PSGallery            PowerNSX is a PowerShell module that abstracts the VMw...

add a physical nic to virtual standard switch

$
0
0

I am trying to add a physical nic to a virtual standard switch.

 

the command i am trying is below.

 

Get-VirtualSwitch vSwitch0 | Add-VirtualSwitchPhysicalNetworkAdapter -VMHostPhysicalNic vmnic5

 

Add-VirtualSwitchPhysicalNetworkAdapter : Cannot bind parameter 'VMHostPhysicalNic'. Cannot convert the "vmnic5" value of type "System.String" to

type "VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic".

At line:1 char:89

+ ... 0 | Add-VirtualSwitchPhysicalNetworkAdapter -VMHostPhysicalNic vmnic5

+                                                                    ~~~~~~

    + CategoryInfo          : InvalidArgument: (:) [Add-VirtualSwitchPhysicalNetworkAdapter], ParameterBindingException

    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,VMware.VimAutomation.ViCore.Cmdlets.Commands.AddVirtualSwitchPhysicalNetworkAdapter

 

 

 

I can do it the old way but it complains it will be deprecated in a future release.

 

PS C:\WINDOWS\system32> Set-VirtualSwitch -VirtualSwitch vSwitch0 -Nic vmnic0,vmnic5

WARNING: Parameter 'Nic' is obsolete. This parameter is deprecated. Use Add-VirtualSwitchPhysicalNetworkAdapter instead.

Datastore vMotion Linked Clone VMs

$
0
0

I have situation where I have a bunch of VMs that I created via Powershell that are linked clones.  So I am not using View to manage them.  My problem is, I want to do some maintenance on the storage server they reside.  If I try to datastore migrate them to another storage server vCenter makes a copy of the base replica (that each VM shares) for each VM.  I could probable shut down the VMs then copy the files, but...

 

Can anyone recommend some code I could use that would allow me migrate powered on, linked clone VMs to another datastore without having to copy the base replica?

 

Thanks,

disabling vmotion traffic on management port_powercli(get-view)

$
0
0

Hello Luc,

 

could you check following code .this is to disable vmotion traffic on mangement port (vmk0) .

this works fine but i wanted to develop using get-view .in your last post yu mentioned

we can view esxi using -property name,config.network.vnic

 

however issues i am getting is i dont see any nested properties corresponding to managementtrafficenabled and vmotionenabled

also we need to find method corresponding to Set-VMHostNetworkAdapter -VMotionEnabled $false.

 

i have been checking hostvirtualnic object in api documentation but did not find anything or iam not able to understand .need you help if following code can be converted using get-view way.

 

 

 

 

 

 

$vmhosts=get-vmhost -location $cluster

 

foreach($hos in $vmhosts)

{

$vmkernel=Get-VMHostNetworkAdapter -VMKernel -VMHost $hos|Where-Object{$_.managementtrafficenabled -eq $true -and $_.vmotionenabled -eq $true}

$vmkernel|select @{N='esxi name';E={$hos.name}},@{N='vmkernel port';E={$_.name}}

if ($vmkernel -eq $null)

{

Write-Output "nothing to remediate for traffic separation"

}

else

{

$rem1=read-host " do yu want to remediate traffic separation"

}

if($rem1 -eq "yes")

{

write-output "remediating traffic separation"

 

$vmkernel|Set-VMHostNetworkAdapter -VMotionEnabled $false -confirm:$false

 

 

}

 

 

}

Multiple connections to the same VC?

$
0
0

Hi,

 

I've been trying to get around the issue that some users don't have permissions to set DRS cluster group membership by connecting an additional user ("service account") to the same VC who has "modify cluster" permissions.

I've tried specifying the server using -Server ($global:DefaultVIServers | ?{$_.User -eq $ServiceAccount}) and it works when running manually, but when I run it in a script file it throws below error:

 

Set-DrsClusterGroup : 2017-11-08 15:54:17 Set-DrsClusterGroup Permission to perform this operation was denied. Required

privilege 'Host.Inventory.EditCluster' on managed object with id 'ClusterComputeResource-domain-c5869'.

+ ... " | Set-DrsClusterGroup -Server ($Global:DefaultVIServers | ? ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Set-DrsClusterGroup], NoPermission

    + FullyQualifiedErrorId : Client20_ComputeResourceServiceImpl_SetDrsClusterGroup_ViError,VMware.VimAutomation.ViCore

.Cmdlets.Commands.SetDrsClusterGroup

 

 

I've tried disconnecting the user then connecting the service account and it works when running manually, but when I run it in a script file it throws below error.

 

Get-DrsClusterGroup : 2017-11-09 10:42:24 Get-DrsClusterGroup Server domain\username@vcenter.domain.local:443 is not connected.

+ ...             Get-DrsClusterGroup -Type VMGroup -Cluster $Cluster -Name ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (:) [Get-DrsClusterGroup], ViServerConnectionException

    + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_TryVerifyIsConnected_NotConnected,VMware.VimAutomation.Vi

Core.Cmdlets.Commands.GetDrsClusterGroup

 

 

Command: Get-DrsClusterGroup -Type VMGroup -Cluster $Cluster -Name $DRSGroup | Set-DrsClusterGroup -Add -VM $VMName

Powershell Version: 5.1.15063.674

PowerCLI Version: 6.5.2.6234650

 

 

It seems that the first user I connect with keep running commands even if I disconnect the user session and connect a new one when running it as a script, not as a terminal.

How can I switch user/connection in a script or specify which user/connection to use when running a command that does not have the -User parameter?

Error using Get-VIEvent cmdlet - Server 2016 / PS 5.1 / PowerCLI 6.5

$
0
0

Hi,

 

On a Windows 2016 server running PowerShell 5.1, I get the following error when calling Get-VIEvent:

 

get-vievent : 8/23/2017 5:15:07 PM Get-VIEvent Error in deserializing body of reply message for operation 'RetrieveProperties'.

At line:1 char:1

+ get-vievent

+ ~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Get-VIEvent], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetEvent

 

It works fine on a server running Windows 2012 r2 and PowerShell 5.

 

Thanks,

Joel


vCloud Director 8.20: How to change the owner of a vApp?

$
0
0

I'm not able to change the owner of a vApp using the SET_CIVAPP cmdlet. The  -Owner option in SET-CIVAPP is not working. I get the following error:

 

Set-CIVApp : 11/9/2017 8:42:39 PM    Set-CIVApp        Object reference not set to an instance of an object.

 

CategoryInfo          : NotSpecified: (:) [Set-CIVApp], CIException

FullyQualifiedErrorId : CloudImpl_UserService_GetUserForSysAdmin,VMware.VimAutomation.Cloud.Commands.Cmdlets.SetCIVApp

VSAN Host Maintenance Mode and Reboot

$
0
0

I'm trying set a vsan node into Maintenance mode, I want to script a rolling reboot of all nodes in a cluster. Of course I need to build some logic to insure before rebooting subsequent nodes that the vsan is healthy but just trying to figure out the required code to actually put it into maintenance mode with the evacuate VM's and insure "ensure accessibility" option ?

vCloud Director 8.20: How to set the default storage policy for VMs in a template?

$
0
0

vCloud Director clears the default storage policy for VMs every time you update the template. Is there a powerCLI script to reset the storage policy for VMs in a template?

script-structure_powercli

$
0
0

Hello Luc,

 

By mistake i deleted previous post for this query.

 

however below is your response.but i dont see any changes to what i posted .

also we are using RemoveAllSnapshots($true) so that means it shoud remove all snapshots .

my specific question is once snapshotdeletion started will script not pick the second task of traffic remediation.

 

 

 

 

$conn = $global:defaultviserver

 

if ($conn -cne $null) {

    write-output "there is already session to" $conn.name

    disconnect-viserver "*" -force -confirm:$true

 

}

 

$vc = read-host "provide the vcenter name"

connect-viserver -server $vc -username "administrator@vsphere.local" -password ""

$cluster = read-host "provide the cluster name"

 

 

foreach ($vm_snapshot in (Get-View -ViewType VirtualMachine -Property Name, snapshot -SearchRoot $cluster.MoRef|? {$_.snapshot -cne $null})) {

    $vm_snapshot.name

    if ($vm_snapshot -eq $null) {

        write-output "nothing to remediate for snapshot"

    }

    else {

        $rem = read-host "do yu want to remediate snapshot"

    }

    if ($rem -eq "yes") {

 

        write-output "deleting snapshot please wait"

        $vm_snapshot.RemoveAllSnapshots($true)

    }

}

 

#traffic separation

 

$vmhosts = get-vmhost -location $cluster

 

foreach ($hos in $vmhosts) {

    $vmkernel = Get-VMHostNetworkAdapter -VMKernel -VMHost $hos|Where-Object {$_.managementtrafficenabled -eq $true -and $_.vmotionenabled -eq $true}

    $vmkernel|select @{N = 'esxi name'; E = {$hos.name}}, @{N = 'vmkernel port'; E = {$_.name}}

    if ($vmkernel -eq $null) {

        Write-Output "nothing to remediate for traffic separation"

    }

    else {

        $rem1 = read-host " do yu want to remediate traffic separation"

    }

    if ($rem1 -eq "yes") {

        write-output "remediating traffic separation"

 

        $vmkernel|Set-VMHostNetworkAdapter -VMotionEnabled $false -confirm:$false

 

 

    }

 

 

}

 

#sshdisable

 

foreach ($esxi in $vmhosts) {

    $sshpolicy = Get-VMHostService -VMHost $esxi | Where {$_.Key -eq "TSM-SSH"}

 

 

    if ($sshpolicy.running -eq $false) {

        write-output "nothing to remediate for ssh service in $esxi"

 

    }

    else {

        $rem2 = read-host " do yu want to remediate ssh"

 

    }

    if ($rem2 -eq "yes") {

        write-output "remediating ssh"

 

        Stop-VMHostService $sshpolicy -Confirm:$true

 

    }

}

Get List of IP addresses for each VM

$
0
0

Hello,

I have a script to get Ip address and vm name:

 

Get-VM | Select Name,VMHost, @{N="IP Address";E={@($_.guest.IPAddress[0])}} |

Export-Csv -NoTypeInformation C:\Users\gemela\Desktop\machine_ip.csv

 

I get only one IP, I want to get also management ip and backup ip.

 

Is possible? ideally will be nice to get all IP for each machine.

 

Thanks

Get deep information about VM disks

$
0
0

Hello,

There is a way with powershell where I can get deeply information about disk in VMware?

 

Disk space: allocate/provisioned, cylinders..not sure if is possible to get this kind of info.

Validate storage vmotion compatibility with powerCLI

$
0
0

If I use vSphere Web Client to storage vMotion a VM, it does a compatibility / validation when I select the datastore and tells me whether the storage vmotion will succeed before I try it.  If there are any issues such as the datastore isn't mounted to the ESXi host the VM is on - it will tell me before I attempt the sVmotion and the compatibility check / validation will fail.

 

What I'd like to do is take a VM I'm about to sVmotion and do a compatibility check before I actually attempt the storage vMotion and see if there are any issues first.

 

Can this be done in PowerCLI?

 

Thanks!


Nested try / catch bocks

$
0
0

I have a try catch block that I'm using to storage vmotion a VM.  Can I put a second try catch block nested inside it when I look up the VM name?  For example:

 

Import-Csv -Path 'vmlist.csv' -UseCulture |

try{

foreach {

get-vm | $_.vmname

move-vm -datastore $_.destinationdatastore

 

#A whole bunch more code is here

}

catch

{

write-host "Vm couldn't be moved"

return

}

}

 

When I try to look up the Vm based on the name in my input file, sometimes it errors out ungracefully when the VM has been renamed or deleted.

Will PowerCLI handle something like this?

 

 

 

Import-Csv -Path 'vmlist.csv' -UseCulture |

try{

foreach {

try{

get-vm | $_.vmname

}

catch{

write-host "This VM is no longer present in vCenter inventory under this name"
}

move-vm -datastore $_.destinationdatastore

#A whole bunch more code is here

}

catch

{

write-host "Vm couldn't be moved"

return

}

}

 

I need to give a more graceful response when a VM doesn't exist but

Can this be done and if so SHOULD it be done?

 

Thanks!

Hash Table from CSV not working for Invoke-VMHostProfile

$
0
0

Hi All I can't figure out what I'm doing wrong. I can get Host profile to remediate with this way:

 

$hostdns='192.168.1.24'

$profile='vmlabs-master-hp'

#step2

$VMHost=Get-VMHost$hostdns

$profilename=Get-VMHostProfile-Name$profile

#step3

Invoke-VMHostProfile-profile$profilename-entity$VMhost-AssociateOnly-confirm:$false

$AdditionalConfiguration=Invoke-VMHostProfile-profile$profilname-entity$VMHost-ApplyOnly-confirm:$false

$AdditionalConfiguration.GetEnumerator()|selectName

#step4

 

$AdditionalConfiguration[‘network.dvsHostNic["key-vim-profile-host-DvsHostVnicProfile-DSwitch-MGMT-vmk0"].ipConfig.IpAddressPolicy.subnetmask']="255.255.255.0"                                                           

$AdditionalConfiguration[‘network.dvsHostNic["key-vim-profile-host-DvsHostVnicProfile-DSwitch-VMOTION-vmk1"].ipConfig.IpAddressPolicy.address']="10.1.1.24"                                                           

$AdditionalConfiguration[‘network.dvsHostNic["key-vim-profile-host-DvsHostVnicProfile-DSwitch-VMOTION-vmk1"].ipConfig.IpAddressPolicy.subnetmask']="255.255.255.0"                                                                                                                                     

$AdditionalConfiguration[‘network.dvsHostNic["key-vim-profile-host-DvsHostVnicProfile-DSwitch-VSAN-vmk2"].ipConfig.IpAddressPolicy.address']="10.2.2.24"                                                          

$AdditionalConfiguration[‘network.dvsHostNic["key-vim-profile-host-DvsHostVnicProfile-DSwitch-VSAN-vmk2"].ipConfig.IpAddressPolicy.subnetmask']="255.255.255.0"                                                         

$AdditionalConfiguration[‘network.dvsHostNic["key-vim-profile-host-DvsHostVnicProfile-DSwitch-NFS-vmk3"].ipConfig.IpAddressPolicy.subnetmask']="255.255.255.0"                                                           

$AdditionalConfiguration[‘network.dvsHostNic["key-vim-profile-host-DvsHostVnicProfile-DSwitch-NFS-vmk3"].ipConfig.IpAddressPolicy.address']="100.10.10.24"                                                               

$AdditionalConfiguration[‘network.dvsHostNic["key-vim-profile-host-DvsHostVnicProfile-DSwitch-MGMT-vmk0"].ipConfig.IpAddressPolicy.address']="192.168.1.24"

#step5 - View hash table

$AdditionalConfiguration|ft-AutoSize

#step6 - Remediate

Invoke-VMHostProfile-Entity$vmhost-Variable$AdditionalConfiguration-Confirm:$false

 

But can't get it working when trying to import info from csv and hash table like this: (With method it attaches the profile but doesn't apply anything)

 

$answerfile=Import-CSVC:\scripts\ProfileAnswers.csv

 

#Loop through each row and apply host profile

foreach($datain$answerfile) {

 

$profile=Get-VMHostProfile$data.profile

 

#Set VMhost variable to be able to pipe objects

$VMhost=Get-VMhost$data.hostname

Write-HostStarting ($VMhost.name)

 

#Attach host profile to host

Invoke-VMHostProfile-profile$profile-entity$VMhost-AssociateOnly-confirm:$false

 

#Get hash table for answer file and assign to configuration

Write-Host“Getting Hash Table Answer File”

$AdditionalConfiguration=Invoke-VMHostProfile-profile$profile-entity$VMHost-ApplyOnly-confirm:$false

 

#Switch Statement to read in hash table and then set keys for Vmotion IP and Management IP on DVS

$var= @{}

If($AdditionalConfiguration){

switch ($AdditionalConfiguration.GetEnumerator()){

{$_.name -like‘*MGMT*.address’ }{$var+= @{$_.Name =$data.mgmtip}

}

{$_.name -like‘*MGMT*.subnetmask’}{$var+= @{$_.Name =$data.mgmtmask}

}

{$_.name -like‘*VMOTION*.address’}{$var+= @{$_.Name =$data.vmotionip}

}

{$_.name -like‘*VMOTION*.subnetmask’}{$var+= @{$_.Name =$data.vmotionmask}

}

{$_.name -like‘*VSAN*.address’}{$var+= @{$_.Name =$data.vsanip}

}

{$_.name -like‘*VSAN*.subnetmask’}{$var+= @{$_.Name =$data.vsanmask}

}

{$_.name -like‘*NFS*.address’}{$var+= @{$_.Name =$data.nfsip}

}

{$_.name -like‘*NFS*.subnetmask’}{$var+= @{$_.Name =$data.nfsmask}

}

}

}

#Set Host in maintenance mode, apply profile with answer file,  test for compliance

Write-Host“Apply Profile to $VMHost

#Set-VMHost -VMHost $VMhost -State ‘Maintenance’

Invoke-VMHostProfile-Entity$vmhost-Variable$var-Confirm:$false#| Test-VMHostProfileCompliance

}

 

######## CSV ##########

"hostname","mgmtip","mgmtmask","vmotionip","vmotionmask","vsanip","vsanmask","nfsip","nfsmask","profile"

"192.168.1.24","192.168.1.24","255.255.255.0","10.1.1.24","255.255.255.0","10.2.2.24","255.255.255.0","100.10.10.24","255.255.255.0","vmlabs-master-hp"

PowerCLI errors updating SNMP on ESXi6.5

$
0
0

     So I've got an interesting problem that I can't pin down the cause to.

 

     The goal is to have a bit of PowerCLI script import a CSV file, select the SNMP values of the correct row (determined by the user) and apply them to the targeted ESXi host.  While I'm beefing up the script beyond that now with logging and error checking and the like, I get a random error that doesn't prevent the server from having its values updated...

 

"Message: UpdateDaemon() call failed, reason: Agent not responding, connect uds socket(/var/run/snmp.ctl) failed 4, err= Interrupted system call;

InnerText: UpdateDaemon() call failed, reason: Agent not responding, connect uds socket(/var/run/snmp.ctl) failed 4, err= Interrupted system callEsxCLI.CLIFault.summary

At C:\Powershell\update-esxsnmp.ps1:63 char:1

+ $esxcli.system.snmp.set.Invoke(@{loglevel = $snmp.loglevel})

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OperationStopped: (:) [], ViError

    + FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.ViError"

 

So, the server I'm working on is in-LAN, response times under 4ms.  Making the call from my desktop.  I can reset the test server and re-run the code and different elements will pop this error.  As far as I can tell, this is essentially a nuisance variable as the values in the CSV do make it to the ESXi host otherwise.  Error doesn't come up based on the previous value of the field in SNMP - this'll come up regardless when it pops.

 

That said, I want to eliminate the error for peace of mind if nothing else.

 

SO!  Here's the meat of the code, detailing how it spins up and the calls it makes to SNMP changes:

 

$SNMP = import-csv $file | where {$_.host -eq $template}

write-host $snmp

connect-viserver $VCServer

$vmhost = get-vmhost $esxhost

$esxcli = get-esxcli -vmhost $vmhost -v2

 

 

if ($template -ne 'clear')

{

write-host "Updating Auth value: " $snmp.authentication

$esxcli.system.snmp.set.Invoke(@{authentication = $snmp.authentication})

write-host "Updating Enable value: " $snmp.enable

$esxcli.system.snmp.set.Invoke(@{enable = $snmp.enable})

write-host "Updating Engine value: " $snmp.'engine id'

$esxcli.system.snmp.set.Invoke(@{engineid = $snmp.'engine id'})

write-host "Updating hwsrc value: " $snmp.hwsrc

$esxcli.system.snmp.set.Invoke(@{hwsrc = $snmp.hwsrc})

write-host "Updating Storage value: " $snmp.largestorage

$esxcli.system.snmp.set.Invoke(@{largestorage = $snmp.largestorage})

write-host "Updating loglevel value: " $snmp.loglevel

$esxcli.system.snmp.set.Invoke(@{loglevel = $snmp.loglevel})

write-host "Updating Port value: " $snmp.port

$esxcli.system.snmp.set.Invoke(@{port = $snmp.port})

write-host "Updating privacy value: " $snmp.privacy

$esxcli.system.snmp.set.Invoke(@{privacy = $snmp.privacy})

write-host "Updating Users value: " $snmp.users

$esxcli.system.snmp.set.Invoke(@{users = $snmp.users})

write-host "Updating v3targets value: " $snmp.v3targets

$esxcli.system.snmp.set.Invoke(@{v3targets = $snmp.v3targets})

write-host "Updating Contact value: " $snmp.syscontact

$esxcli.system.snmp.set.Invoke(@{syscontact = $snmp.syscontact})

 

Thoughts?

Clone a template to Content library

$
0
0

Hello all,

 

I'm looking for a powercli example to convert a classic template to an existing content library.

Have you ever done that?

 

I dont find documentation for this subject.

Regards,

Alexandre.

COS Traffic Marking

$
0
0

I can't seem to find anything on traffic marking for port groups.  Is anyone doing this via PowerCLI?  Can you point me in the right direction please?

Viewing all 16717 articles
Browse latest View live