VM Created and Deleted events using PowerCLI

A quick one liner to find the the users who created or deleted the VM in the past 7 days. This can be fetched using the TaskEvent which has the description VmBeingDeployedEvent or VmBeingClonedEvent and VmRemovedEvent . If you want  to know the count for longer period then change the number AddDays to longer value Here is code for getting the VM creation […]

FacebookTwitterGoogle+LinkedInShare

Storage vMotion Events using PowerCLI

In the previous post I have showed how to get the count of the vMotion using PowerCLI. In this I will walkthrough the events which we can use the track the Storage vMotion using PowerCLI. The Storage vMotion events can be tracked using the description VirtualMachine.relocate and StorageResourceManager.applyRecommendation and here is the quick one line which you […]

FacebookTwitterGoogle+LinkedInShare

vMotion Count using PowerCLI

A quick one liner to find the count of vMotion which has happened in the past 24 hrs. This can be fetched using the TaskEvent which has the description  VirtualMachine.migrate. If you want  to know the count for longer period then change the number AddDays to longer value   Get-VIEvent -Entity (Get-VM -Location $_) -MaxSamples ([int]::MaxValue) -Start […]

FacebookTwitterGoogle+LinkedInShare

VM Advanced settings with PowerCLI

Applying VM advanced settings manually on each individual VM’s can be tedious task and need to Power down the VM to perform the activity. With the help of PowerCLI the task has been very much simplified with the help of cmdlet called New-AdvancedSetting I use the below script to to add the additional settings to […]

FacebookTwitterGoogle+LinkedInShare

Listing Memory Limits on VM’s using PowerCLI

A quick small post to list the memory limits on the VM and set it back to unlimited using a PowerCLI To list the VM’s which have memory limit configured Get-VM | Get-VMResourceConfiguration | where {$_.MemLimitMB -ne ‘-1’}  | Select VM,MemLimitMB And to set it to unlimited Get-VM | Get-VMResourceConfiguration | where {$_.MemLimitMB -ne ‘-1’}  | Set-VMResourceConfiguration […]

FacebookTwitterGoogle+LinkedInShare

Creating VM using PowerCLI

A quick post to build multiple VM’s using PowerCLI Import-Csv “D:Scriptsvm.csv” -UseCulture | %{ Get-OSCustomizationSpec $_.Customization | Get-OSCustomizationNicMapping |` Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $_.”IP” ` -SubnetMask $_.SM -DefaultGateway $_.DG -Dns $_.DNS $vm=New-VM -Name $_.”VM” -Template $_.Template -Host $_.”ESX” ` -Datastore $_.Datastore -OSCustomizationSpec $_.Customization -Confirm $False-RunAsync:) } Input of the CSV file is as below Enjoy […]

FacebookTwitterGoogle+LinkedInShare

Disk I/O Timeout setting on VM

Recently I had a task to adjust Window VM Disk IO Timeout Settings to 190 sec as per the NetApp best Practice so that VM Wont loose connection to the disk incase of the cluster failover. This can be adjusted by editing the following registry key HKLMSYSTEMCurrentControlSetServicesDiskTimeoutValue I know this can be achieved using Power CLI and i did a little […]

FacebookTwitterGoogle+LinkedInShare

Get SP level of computer

This script connects to Active Directory OU or just the root of the domain and recursivly gets all the computer objects for each AD computer object it gets the Opertating system Type , Version and Service pack using information of the AD object. function get-alladcomputers {Trap { Write-Host -ForegroundColor Red ” <<>> could not connect […]

FacebookTwitterGoogle+LinkedInShare
Proudly powered by WordPress   Premium Style Theme by www.gopiplus.com