Change / events followed with PowerCLI
Suppose I want to follow all the events in vSphere that are initiated by a given user account. How can I create a report that will select all the measures taken by a given user and report the details of these actions?
Thank you!
Who could look like this.
Get-VIEventPlus -EventType VmReconfiguredEvent -Start (Get-Date).AddDays(-1) -User "domain\user"
It returns all changes to the VM user domain\user during the last 24 hours.
Tags: VMware
Similar Questions
-
Change the database with PowerCLI retention policy
Anyone know if you can change the settings for retention policy database of vCenter with PowerCLI (Powershell v1.0)?
The settings I want to modify are:
The administration | vCenter Server Settings | Data retention policy. For tasks AND event held for
I am using vCenter 4 update 4.
I see, in this case we will have to fall back on the underlying method of the SDK.
Try like this (you must be connected to the vCenter)
$si = Get-View ServiceInstance $optMgr = Get-View $si.Content.Setting $spec = @() $event1 = New-Object VMware.Vim.OptionValue $event1.key = "event.maxAge" $event1.value = 120 $spec += $event1 $event2 = New-Object VMware.Vim.OptionValue$event2.key = "event.maxAgeEnabled" $event2.value = $true$spec += $event2 $task1 = New-Object VMware.Vim.OptionValue$task1.key = "task.maxAge" $task1.value = 120$spec += $task1 $task2 = New-Object VMware.Vim.OptionValue$task2.key = "task.maxAgeEnabled" $task2.value = $true$spec += $task2 $optMgr.UpdateOptions($spec)
-
I need a way to change the Login with PowerCLI 5.5 banner
So I'm having a lot of problems with the fixing of the banner of connecting through Host Profiles. It does not change the formatting at all, and it always shows not permitted even after the application. Someone has found a way to define it with PowerCLI? I saw ways to connect directly to the host ssh but I want to with a session PowerCLI, vCenter and does not direct connection to the host. I would like to know if anyone has found anything!
Thank you.
We had a similar thread before, see script logon banner , but without using SSH, as I know there is no way to do it.
-
Cannot change 1 advanced with PowerCli
Hello
I prepare our ESX 3.5 infra to migrate to vSphere4. of course, I adapt to my powershell script.
one of them is the basic configuration of our new ESXi.
I'm stuck in a strange. I mean my script changes several options with no problems, but when I try to change the
Mem.HostLocalSwapDirEnabled
from 0 to 1, I threw a:
Exception calling "UpdateOptions" with '1' arguments: 'a specified parameter was not correct.
"
To: line: 237 char: 21
+ $optMgr.UpdateOptions < < < < ($optarr)
Here is my code:
$tgtkey = "Mem.HostLocalSwapDirEnabled".
$tgtvalue = 1
$optMgr = get-view-Id $ESXHostView.ConfigManager.AdvancedOption
$optarr = @)
$option = new-Object VMware.Vim.OptionValue
$option.key = $tgtkey
$option.value = $tgtvalue
$optarr += $option
$optMgr.UpdateOptions ($optarr)
This change works well against esxi 3.5. I check that the option has not changed.
any ideas would be most welcome.
Thank you very much
Eric
Hi Eric,.
Don't know why or where it is documented, but this setting seems to want an int64 value, where it used to be an int32.
It works in vSPhere
$ESXHostView = Get-VMHost mmmstv004.muac.corp.eurocontrol.int | Get-View $tgtkey = "Mem.HostLocalSwapDirEnabled" $tgtvalue = [int64]1 $optMgr = Get-View -Id $ESXHostView.ConfigManager.AdvancedOption $optarr = @() $option = New-Object VMware.Vim.OptionValue $option.key = $tgtkey $option.value = $tgtvalue $optarr += $option $optMgr.UpdateOptions($optarr)
____________
Blog: LucD notes
Twitter: lucd22
-
in bulk license with PowerCLI 6.0 Release 2 broken?
Hello
I upgraded successfully to PowerCLI 6.0 Release 1 to PowerCLI 6.0 Release 2.
After that, I wanted to add a new license to the license in bulk newly deployed ESXi Hosts with Auto deploy but encountered the following error:
$licenseData = new-Object VMware.VimAutomation.License.Types.LicenseData
New-Object: cannot find type [VMware.VimAutomation.License.Types.LicenseData]: check that the assembly containing this type is loaded.
On line: 1 char: 16
+ $licenseData = new-Object VMware.VimAutomation.License.Types.LicenseData
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: InvalidType: (:)) [New-Object], PSArgumentException)
+ FullyQualifiedErrorId: TypeNotFound, Microsoft.PowerShell.Commands.NewObjectCommand
I'm sure that it worked with PowerCLI 6.0 Release 1.
Did someone else run into it as well? Perhaps no work around?
I appreciate your help.
see you soon,
Ronny
Hello
It is a backward compatibility problem that was introduced in PowerCLI 6.0R2. It will be addressed in a version of the next patch very soon, but until then, you can work around
replacement of
'VMware.VimAutomation.License.Types.LicenseData '.
with
'VMware.VimAutomation.License.Types.V1.LicenseData '.
Keep in mind that if you do the above to make your script works and later upgrade your PowerCLI to a version more recent that you should check back this change in scripts.
-Dimitar Milov
-
Change event of the checkbox in ActionScript?
Hello
I am creating a custom canvas. The canvas Gets an array of labels and populate a list of checkboxes with labels provided. In the Web, I have a checkbox "Select all" static. Activation of the box will select populated of all the boxes. Off selecting him 'select all' will be clear all the check boxes.
Since I fill the box as follows:
public function InitApp (): void
{
var NewCtrl:CheckBox;
var str:String;
for (var i: int = 0; i < LabelArr.length; i ++)
{
NewCtrl = new CheckBox();
NewCtrl.label = LabelArr . toString();
NewCtrl.selected = true;
VBoxCtrl.addChild (DisplayObject (NewCtrl));
}
}
Here's the question. If the user wants to deselect a checkbox, I want to deselect the button 'select all '. How can I do? Since the "change" event is not available in actionscript, I do not know to do. :(
Help, please.Why do you say "change" event is not available in AS?
You can use newCtrl.addEventListener ('change', handler) and the action required in the Manager.
-
Calendar, more a change event
Hi all, I tried to change more then another event, (events of garbage this year, import the desktop) but without success. With the help of Automator, it shows me the events in this new year, but there is no script to change events. Next step, I was looking on the net, impossible to find solutions. I want to put a new recall for my calendar, so that I don't miss the events of Garbage.
El Capitan 10.11.2 sytem
You can set a reminder using the reminders app OR you can add an event in the calendar app and activate an alert for this event.
-
"Error Out.status": Value change event.
I get no event that fires when the error on the 'status' change?
Change event simply write data to a terminal indicator do not have a value.
The only things that cause a value change event are the user interaction with a control, or by writing to the (signalling) Value property of a control or the indicator.
-
How to reset a while loop based on a value change event?
Hi all
I work in a labview program that sends voltage to a laptop via USB 6008, tension is amplified by an op-amp, and then he comes back in the laptop. I created a program and a working circuit, but my current challenge is how to reset the average of the values of voltage coming into the laptop, after that the user changes the digital control (which controls the output voltage). In other words, I need to be able to reset the number of iteration and the sum to 0 each time this happens.
I looked upward to reset the counters of iteration through shift registers, but I'm not sure it will work in this case, but I'm also not sure how to reset the sum of an array (if possible). I have spent a lot of time to read these forums and tutorials from various sites, so I think it can be done with the correct nesting of the case structures, structures of the event and while loops, but I don't know how. I am new to LV, just started to learn in mid-January, so any help is appreciated.
Thanks in advance,
Graeme
You just need the structure of single event with the bargains. Use the case of timeout to get your new values and find the average (100ms timeout value and get rid of the wait function (ms)). Keep the amount and the number of items in the shift registers. Wire these values through each case of the event. In the event of changing the value: control, just set the values to 0. Then add a Stop button value change event to stop your program.
-
Why "limit maximum instances of this event in the queue" in the dialog box change events?
Why I "would limit the maximum instances of this event in the queue" in the dialog box change events?
I think that this is new for LV 2014, but I couldn't find an explanation for an instance of good use. A research on OR displays only the 2014 help text, which explains what it does, but not why?
Does anyone know good arguments to use this option?
Thanks in advance.
Justin Tyme
It is useful for user interface elements that can enqueue actions as quickly as they can be made.
For example, say it takes takes 1 second to take a picture and save it. The user presses the button "Take a photo", but they do not see a new image file again after a wait of 250 ms (human beings humans can be impatient) so they press twice. Finally, they see a new file image... and then another... and then another... To get rid of this possibility, check this box.
Or that you have a cursor to adjust some settings. Moving the cursor updates very fast! If the user swipes from 0 to 1 then the program might try to send all the rest as a parameter to your instrument, which takes some time. Instead of sending all of these values, it is probably better if the software can keep up with the cursor and send a value of about 1 at the same time, the cursor said 1. If you do not check this box, the user can be 1, but the unit will continue to receive values from 0.53, 0.54, 0.55...
-
How to get the ActiveX component value change event?
Hi all
LV 8.6.1
I try to get the ActiveX component value change event. I covered forum and through examples, but I can't get an idea of how "Recalling vi. For example, in the example 'ActiveX event Callback for IE.vi' it is used "recall vi". I've added an example where the change event of value with the mouse to the bottom of the event are scheduled to the structure of the event. Mouse down event OK work but change the value no. Can anyone describe what I need to add to my example vi who value the change event works fine?
BR, Jim
Here is the solution! "Value changed event" is not performed in the structure of the event, but in "Reminder VI".
-
Value change event, be it be programmed to trigger only when the USER changes the value?
The structure I set up is the following, I have a control in which the user chooses a value when they choose this value, the value change event takes place setting in the device. Then I am bed in unit values and display them in this control via a property node.
My problem is that whenever I read back a new value in the control, he takes this as a value change event and resets the value within the system, is it possible to make this event don't move when the user changes the value?
Yes!
My thoughts are that you use a Value property (signalling) node to display for the control. That will trigger another call to event.
Use the NO signs of property value node or a local variable.
Your postal code, if this isn't the case, then we can help you understand what is happening.
-
How to enable notification of change of value with DSC for several variables
Hello
I would like to request a notification with DSC for two shared variables value saved for change events. In the example attached, it is no problem to do it for only a variable. But I have no idea how to do to achieve for that variable.
Any ideas?
Matthias
Hi Matthias,
You can implement it as you can see in the attached example.
Best regards
Mencef -
How can I get the version of VMware to virtual machines with powercli officer?
How can I get the version of VMware View Agent running on a virtual machine with powercli or view Powercli?
As much as I know there is no cmdlet PowerCLI for this, but you can use the Invoke-VMScript cmdlet and interrogate the Win32_Product class.
By running the following. You can add a Where clause to return only the Agent of the view
Get-WmiObject-class Win32_Product | Select the name, Version
-
count the number of targets, devices and paths by hba for each host with powercli 5.5
Hi all
I'm writing this Question again in the community, was not able to found the answer I was looking for in the nets:
https://communities.VMware.com/thread/516226?start=0 & tstart = 0
https://communities.VMware.com/thread/293531
I went through the scripts provided in the community, but seems that t not work on powercli 5.5.
///
# The target account, devices and paths for each host
Get-Cluster $cluster | Get-VMHost | Sort-Object-property name. {ForEach-Object
$VMHost = $_
$VMHost | Get-VMHostHba-type FibreChannel | Sort-Object-property device | {ForEach-Object
$VMHostHba = $_
$ScsiLun = $VMHostHba | Get-ScsiLun
If {($ScsiLun)
$ScsiLunPath = $ScsiLun | Get-ScsiLunPath | `
Where-Object {$_.} Name - like "$($VMHostHba.Device) *"} ".
$Targets = ($ScsiLunPath |) »
Group-object - property SanID | Measure - Object). County
$Devices = ($ScsiLun |) Measure - Object). County
$Paths = ($ScsiLunPath |) Measure - Object). County
}
Else {}
$Targets = 0
$Devices = 0
$Paths = 0
}
$Report = "" | Select-Object - property VMHost, HBA, target devices, paths
$Report.VMHost = $VMHost.Name
$Report.HBA = $VMHostHba.Device
$Report.Targets = $Targets
$Report.Devices = $Devices
$Report.Paths = $Paths
$Report
}
}
///
I went through the script LucD posted below: but it's not exactly what I'm looking for.
LucD : can you please change the same for me please. to count the number of paths per hba for each host with powercli 5.5, devices and targets.
//
$esx = get-VMHost < host name >
foreach ($hba to (VMHostHba Get - VMHost $esx - type "FibreChannel")) {}
$target = ((get - see $hba. VMhost). Config.StorageDevice.ScsiTopology.Adapter | where {$_.} Adapter - eq $hba. Key}). Goal
$luns = get-ScsiLun - Hba $hba - LunType 'disk '.
$nrPaths = ($target | % {$_.}) Lun.Count} | Measure - Object - sum). Sum
Write-Host $hba. Device ' target: ' $target. County "devices:" $luns. County ' path: ' $nrPaths
}
//
I'll be grateful for any help.
Tarun Gupta
Try something like this
{foreach ($esx in Get-VMHost)
foreach ($hba to (VMHostHba Get - VMHost $esx - type "FibreChannel")) {}
$target = ((get - see $hba. VMhost). Config.StorageDevice.ScsiTopology.Adapter | where {$_.} Adapter - eq $hba. Key}). Goal
$luns = get-ScsiLun - Hba $hba - LunType "disk" - ErrorAction SilentlyContinue
$nrPaths = ($target | % {$_.}) Lun.Count} | Measure - Object - sum). Sum
$props [ordered] = @ {}
VMHost = $esx.name
HBA = $hba. Name
Target = $target. County
Device = $luns. County
Path = $nrPaths
}
New-object PSObject-property $props
}
}
Maybe you are looking for
-
The Import Wizard ignored during installation, but who want to import safari bookmarks now. do not import wizard on the file menu. Run FFX10 on MAC OS 10.6.8. Thoughts? THX!
-
Computer of my computer fan runs constantly?
My computer is a HP Pavilion dv4-1123us Entertainment Notebook Pc. whenever I use any program that increases computer around 40% CPU usage, the fan begins to operate constantly a little noise to very loud noise. I thought that its caused by a program
-
Draw the rectangle to the intensity chart (position where clicked)
I am able to extract the coordinates using the mouse down and mouse to the top of the structure of the event, but unable to draw the rectangle at the specified position. I get the coordinates to the mouse down and mouse up to the event within these l
-
I'm trying to connect my new smart phone Samsung Note5 to my HP Officejet Pro 6835. It telling me my password is wrong and I've even updated past through HP online on my laptop but it still will not connect, saying: incorrect password. I don't know a
-
When I plug my headphones in the front jack 3.5 external speakers are NOT dumb
Hello I recently reinstalled Vista Ultimate on a bigger hard drive, but now I have a problem with my audio devices. (1) when I plug in my headphones to the port of front 3.5 mm external speakers are NOT dumb. (2) the only way I can switch from headph