Get information about deleted virtual machines
Is is possible to get information on who has erased a VM, or at least when it has been deleted using vCenter Server logs?
Thank you
The cmdlet Get-VIEvent, by default, returns only the 100 events.
Use the - MaxSamples parameter with a very large number to see some results.
Get-VIEvent - MaxSamples 99999.
where {$_.gettype ().} Name - eq "VMRemovedEvent"} |
Select @{N = "VMname"; E={$_. Vm.Name}},@{N = "Createduserid"; E={$_. Createduserid}},
@{N = 'Host'; E={$_. $host.name}},@{N = 'User'; E={$_. User name}} |
Export-Csv "C:\VM-deleted-audit.csv" - NoTypeInformation - UseCulture
Tags: VMware
Similar Questions
-
Impossible to get 'notes' of the virtual machine
I tried to use a powershell script to get information from the virtual machine. I can get VMHost, VMname and GuestVersion using the script in the following, but failed to get the notes of the virtual machine. Anyone know why I can't get notes, please help me with that. Thank you in advance.
report = @)
foreach ($vmView in (Get-View - ViewType VirtualMachine))
{
$report += $vmView. Select-Object @{Name = "$vmhost"; Expression = {($vmView.Runtime.Host Get-View).} Name}},
@{Name = "VMName"; Expression = {$_.} Name}},
@{Name = 'Notes'; Expression = {$_.} Description}},@{Name = "GuestVersion"; {Expression = {$vmView.Guest.GuestFullName}}
}
$report | Sort-Object VMName-descending | Export-Csv "d:\vm_GuestVersion.csv" - NoTypeInformationThere is no need to do it with the cmdlet Get-View.
You can do
$report = @()foreach ($vm in Get-VM){ $report += $vm | ` Select-Object @{Name="VMHost"; Expression={($_.Host).Name}}, @{Name="VMName"; Expression={$_.Name}}, @{Name="Notes"; Expression={$_.Description}}, @{Name="GuestVersion"; Expression={$_.Guest.OSFullName}}}$report | Sort-Object VMName -Descending | Export-Csv "d:\vm_GuestVersion.csv" -NoTypeInformation
If you want to do with the cmdlet Get-View for any reason, you can do
$report = @() foreach ($vmView in (Get-View -ViewType VirtualMachine)) { $report += $vmView | ` Select-Object @{Name="VMHost"; Expression={(Get-View $vmView.Runtime.Host).Name}}, @{Name="VMName"; Expression={$_.Name}}, @{Name="Notes"; Expression={$_.Config.Annotation}}, @{Name="GuestVersion"; Expression={$vmView.Guest.GuestFullName}} } $report | Sort-Object VMName -Descending | Export-Csv "d:\vm_GuestVersion.csv" -NoTypeInformation
But note that as you need a view of the GET each time for the host name, performance will suffer.
-
Get information about the VM name, owner, State of the Machine and tools State
Hello
I want to write a script to get information about the name of VM, owner, status of the Machine and tools State, because I'm a beginner in powershell I couldn't find any solution yet.
I know how to get the name of the virtual machine and the owner
Get-VM | Get-Annotation -CustomAttribute Owner | select AnnotatedEntity, Value
and how to find the tools and the State of the machine
Get-VM | Select-Object -Property Name,@{N="State";E={$_.Guest.State}},@{N="ToolsStatus";E={$_.Guest.ExtensionData.ToolsStatus}}
Unfortunately I don't find a way to merge the two applications.
Can someone help me please?
Kind regards.
SaPu
Try it like this
Get - VM | Select-Object - property Name,@{N="State; E={$_. Guest.State}},
@{N = "ToolsStatus"; E={$_. Guest.ExtensionData.ToolsStatus}},
@{N = "AnnotatedEntity"; E = {$attr. AnnotatedEntity}},
@{N = "Owner"; E = {(Get-Annotation-entité $_-CustomAttribute «Propriétaire»).} Value}} -
I erased from my hard drive to sell the macbook pro to my father. "" When I go to install OSX I am invited to install OS X El Capitan and it will check computer and a window pops up saying 'Impossible to find information about this installation machine' "contact AppleCare. I have an APPT with the Apple store Monday, but was hoping I could fix myself first. Anyone have any ideas?
When you disassemble a machine for sale, the only Mac OS X can be installed without providing WHAT YOUR Apple ID is the original version it comes with.
You can not install ElCapitan in this situation, what is left as an exercise for the buyer.
-
Hi all
I try to get my ORACLE ASM (v 11.1.0.7) software works on Windows Server 2008 Standard SP2 (32-bit), but unfortunately, I hit the next windows operating system error with no resolution in sight.
OSD-04011: GetFileInformationbyHandle() failure, unable to get information about the file
S/O-error: incorrect function (OS 1)Basically ORACLE software try to read the header information of a partition of existing online RAW drive. According to the error made ORACLE unrecognized function call. How can I make this feature available? Need help ASAP please.
http://www.Microsoft.com/windowsserver2008/en/us/community.aspx
They will help you in Windows Server communities at the above address.
Here is the Vista Forums.
See you soon. Mick Murphy - Microsoft partner
-
I get this error message: "unable to listen to a number of files queued. To get information about the problem, click on the icon next to each file in the list pane. "The thing is that he played the songs darned two days ago, what has happened since then!
Never mind. I totally forgot that I had renamed a folder that hosts my music. Duh.
-
Get the list of virtual machine names and addresses IP to a specific folder
I am trying to get a list of virtual machine names and the IP addresses of a specific folder in vCenter. The problem is that there are several files with the same name in different folders. I need to know how to specify the level folder higher in which lies the customer10 folder. Here is an example of my current script that pulls all the info from the virtual machine of all folders named customer10:
Get-vm-location customer10 | Select Address Name,@{N="IP." E = {@($_.guest.) (IPAddress[0])}} |
out-file c:\VM_IP_Addresses.csvThe PowerSHell engine is to 'know' the function before you call it.
Save the function in a .ps1 file.
Point source then this .ps1 file. Make sure that you are placed in the directory where the .ps1 is stored, or use the full path
PowerCLI C:\ >. ./GetFolderByPath.ps1
Note that there is an empty space between the 2 points!
Now you can call the function
PowerCLI C:\ > Get-FolderByPath-path MYDC/myFolder. Get - VM | Select the name...
-
I have problems to find a way to get a list of virtual machines on an ESX host specific and then he dumped to a .csv in the following format
I use the get-vmhost esxhostname | Get - vm
but everyhting else after, it is where I am lost... I think the closest I had been posting the output with a goofy header and format 'vm1, vm2, vm3 "...
name
computer 1 name
computer 2 name
name of the machine 3
to use for later use. Any help would be appreciated.
You must use the Select-Object cmdlet to specify more precisely the properties you want.
The Export-Csv doesn't know how to manage the virtual computer object.
Something like that
Get-vmhost esxhostname | Get - vm | Select name. Export Csv.\report.csv - NoTypeInformation - UseCulture
-
How to get information about the types within a user defined package
Hi all
Have a package with some types (user-defined) defined in the package specification. How to get information about the types and
information about the columns of this type.
for example:
Create package mp is
type t is record (no number is varchar2 (30));
procedure a (m t out...
Thanks in advance.
usergG_user wrote:
the req's, want to build a script dynamically using data dictionary
so if possible, I take the name of the type within the package specification.Let me rephrase - is there a data dictionary to get information on the type defined by the user within a package specification
Best approach will be to have a standard in the definition of data types.
Have a process to follow the object definitions in the package if it is mandatory.
-
Get information about the layer with script styles
Is there a way for a script to get information about the currently existing on a layer layer styles?
For example, can I know if a layer has a drop shadow, and that therefore, find the dimensions of this shadow, transparency, color, etc...?
If you don't have CS4 you will need Xbytor script. With CS4, you can the the layer descriptor
var ref = new ActionReference(); ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID('layerEffects')); if( desc.hasKey( stringIDToTypeID('dropShadow') ) ){ desc = desc.getObjectValue(stringIDToTypeID('dropShadow')); alert('opacity = '+ desc.getDouble( stringIDToTypeID('opacity') ) ); alert('distance = '+ desc.getDouble( stringIDToTypeID('distance') ) ); alert('spread = '+ desc.getDouble( stringIDToTypeID('chokeMatte') ) );// spread alert('blur = '+ desc.getDouble( stringIDToTypeID('blur') ) ); var desc = desc.getObjectValue(stringIDToTypeID('color')); var r = desc.getDouble( stringIDToTypeID('red') ) ; var g = desc.getDouble( stringIDToTypeID('green') ) ; var b = desc.getDouble( stringIDToTypeID('blue') ) ; alert( 'r = ' + r +'\rg = ' + g + '\rb = ' + b ); }
-
Hi all, I'm new here and it's been days I'm trying to find the right script to the list of virtual machines and related information on each cluster and get 1 csv for each individual cluster.
Here is my code:
Get-content C:\cl.txt | % {
$cl = $_
Get - VM | Select-Object @{N = 'Cluster'; {E = {Get-Cluster - VM $_}}, @{Expression = 'Host'; Label = "ESX host"}, @{Expression = "Name"; Label is "VM"},
@{Expression = "Numcpu"; Label = 'vCPU'}, @{Expression = "MemoryGB"; Label = "RAM (GB)"}, "
@{n = "Provisioned Volume"; e = {[math]: tour ($_.)}} (ProvisionedSpaceGB, 2)}}, @{n = "Use the Volume"; e = {[math]: tour ($_.)}} (UsedSpaceGB, 2)}},
@{N = "Ops ARE/s/write"; E = {[math]: tour ((Get-Stat $_-stat "datastore.numberWriteAveraged.average"-en temps réel |))} Select - expand the value | measure - average). Average, 1)}},
@{N = "Ops ARE/s/reading"; E = {[math]: tour ((Get-Stat $_-stat "datastore.numberReadAveraged.average"-en temps réel |))} Select - expand the value | measure - average). Average, 1)}} | Export-Csv - NoTypeInformation - UseCulture 'C:\vm_report_$cl.csv '.
}
Note: each csv is generated for each cluster
CL.txt lists the clusters , but all I get is several files with the same content, and they are not properly renamed
How can I do to generate 1 csv by cluster ?
For example, there are 3 groups A1, A2, A3 (in file cl.txt), we get 3 csv files generated individually A1.csv, A2.csv and A3.csv and related data in them:
A1.csv : A2.csv : A3.csv
Host cluster VM RAM (GB) Cluster ESX VM RAM (GB) Cluster Host ESX VM ESX host
A1 sx0001 su19001 4 sx0001adm 32 su1386adm su10670 A3 iu01990 A2
Sx0001 su23000 A1 2 A2 sx0001adm su12404 32 A3 sx1385adm su10034
Sx0002 su55000 sx0002pack sw12785 A1 2 A2 1 A3 su1384adm iu00025
Help with this script would you gladly.
Thank you
Joseph.
Judging by the timestamp, it seems that these files with spaces between the file name and file type, were made yesterday.
This might have been one of your previous tests?
Maybe do a series of tests of the script in an empty folder.
-
Looking for a Script to extract information for a virtual machine
HiEvryone
Looking for a Script pull information for a virtual of VC machine what operating system installed (2003, 32-bit or 64-bit, 2008 etc), vCPU and memory allocated and State. Output in CSV format.
Thank you
vmguy
You mean something like this
Get-VM | Select Name,NumCpu,MemoryMB,PowerState,@{N="OS";E={$_.Guest.OSFullName}} | Export-Csv "C:\report.csv" -NoTypeInformation -UseCulture
-
HELP - how to get the number of virtual machines on a data store?
Looking at the inventory of the data store in the VI client, there are a "number of Virtual Machines:" according to the General information for the Summary tab... I'm looking for a script that retrieves this information for me...
I started the script but I'm stuck... I am very new on this...
Get-Datastore. WHERE-object {$_ .name - like "wlp" ' "} #this gives me all the data which are not local warehouses
Could someone give an overview on how to script to retrieve the number of virtual machines on data warehouses...
Thank you, Lee
Sorry, something went wrong with the copy - paste
Get-Datastore | where {$_.Name -like "vmfs*"} | Sort-Object -Property Name | %{$_ | select @{N="DSname"; E={$_.Name}}, @{N="VMcount";E={($_ | Get-VM | Measure-Object).count}}}
-
Enumerate devices OR and get information about the device C / C++
Hello
I use using NI_DAQmx. How to find and enumerate devices OR and obtain information about each device listed in C / C++?
I am implementing a dynamic configuration allowing to access hardware OR on our system.
I need to get logical device names, for example "Dev1", and then find what device OR, for example NI 6008, is associated with each device name.
Thank you.
-Neil shore
If you just read the device information while you use DAQmx properties to achieve what you need:
To get the names of all the devices in your system:
DAQmxGetSysDevNames
To get the product to a given device number (each product has a number of unique product in accordance with the reference C DAQmx help, for example, the USB-6008 case is 0x717A):
DAQmxGetDevProductNum
If you need to actually define the names of devices or whatnot, you would then focus on the System Configuration API. I've never really used this outside of LabVIEW, but the Readme indicates he has CVI supports so you might be able to make it work.
Best regards
-
I got 7 a window and a window Vista and I had a VM for XP, I was wondering how I can get Vista on Virtual Machine has what I need, or what I do to make the ISO or. VIRTUAL HARD DRIVE. Help, please
You will need to buy a copy of Windows Vista and install as a virtual machine. There is no free download of Vista. Boulder computer Maven
Most Microsoft Valuable Professional
Maybe you are looking for
-
all of a sudden the audio to youtube does not work? OK but in IE
all of a sudden when I play a YouTube video of the audio does not work. Works fine in Internet Explorer.
-
Re: Tecra A7 - Win XP driver for PC card Type II card necessary
I have not found on the toshiba site, the driver for the PC card slot for 1 x Type II card, type: slot Express Card?where is it possible to download?
-
Satellite A135-S4666 - recovery disk displays an error message
The hard drive crashed while I replaced it. I am trying to use the recovery disk to take the computer to the "out of the box configuration. I chose to 'recover' rather than erase the hard drive based on this choice. Then it copies the files from the
-
Battery no longer charges. Fastboot OK
Hi all After a long time with Android phones since 2009, it is the first time I have a question. Yesterday, I noticed that my phone was low battery and charge it overnight. Do not pay attention a lot the morning and used it a little bit. At work, I n
-
Hello world I have a txt file and it has some data. Specifically, I want to replace a character in the text file. Data will be like this. TT = 15S1ST = 21601S1EN = 50400S2ST = 50401S2EN = 72000S3ST = 72001S3EN = 21600GNST = 00000GNEN = 00000S1B1S = 2