Do you ever require the users of your script to select which file to use?
I do. And it’s no fun trying to do decent error-handling when a user has to type the full path to a file. Nor is it any fun to be that user. So why not use the Windows Forms class [...]
It’s about time I follow up on the post Getting Video Hardware Acceleration Level.
I have created a simple, fire-and-forget script that sets the Hardware Video Acceleration Level for all your (Windows Server 2003 and Powered On) VM’s to Full. This way you can always enjoy smooth mouse movements when working in the console!
It’s a bit tricky to find, but the API reference showed me where to look. And now I’m posting it here, so you don’t have to search any further.
First, connect to the Option Manager:
$SI = Get-View $ServiceInstance
$OM = Get-View $SI.Content.Setting
Query current values of advanced options:
$OM.QueryOptions(‘ADV_OPTION_NAME’)
To change [...]
I’ve got a great new script for you today!
We all love VMware for consolidating our servers. And we all know that virtualization requires lot’s of SAN space. But how do you keep track of the amount of space left on all your datastores? It’s pretty easy to create a report using the [...]
Today’s oneliner is a nifty little function that reports the average CPU and Memory usage for one or more of your VMs, calculated over the last x hours:
function Get-VMStat
{
param( $VM,[Int32]$Hours = 1 )
$VM | Sort Name |
Select Name, @{N=”CPU”;E={[Math]::Round((($_ |
Get-Stat -Stat cpu.usage.average -Start (Get-Date).AddHours(-$Hours) [...]
Do your fellow VMware Admins sometimes forget to fill in the Notes field for a new vm they create? Or would you like to change those inconsistent notes to something more accurate? Todays oneliner simply copies the Active Directory description field into your Virtual Infrastructure. It’s quite blunt about it. Besides asking if [...]
Part two in Some Advice on Creating Powershell Scripts
Now that you have found all sort of interesting properties, you might feel the urge to modify one or two. After all, creating slick overviews is cool, but bricking your entire infrastructure with one script is … well, you get the idea.
A nice challenge today, when trying to answer a question in the VMware VI Toolkit community:
How to get an overview of all my networks and the number of VMs connected to each of them?
It’s unfortunately not possible to get VMs, based on which port group they are connected to. [...]
Creating a Powershell script CAN be quite difficult. How to get the output you want? Where to start? Let me try to get you started by providing a structure you can follow. I’m not saying this is THE way, but it’s MY way. Hope it helps you and please do comment if you [...]
Hi everybody, I’m back!
Before you ask, I’ve had a great holiday, thank you. Now let’s continue having fun with Powershell and the VI Toolkit!
I’ve showed you a trick earlier that allows you to find your Virtual Center Server Settings. The License Server settings for instance. But changing these settings can [...]
Tags
Active Directory API bind order cleanup cluster CPU Custom Fields datastores description device management directory tree errors Event Log file name filter Fun function HA IT known issues License Server LUN multipath NIC objects Oneliner portgroups PowerCLI PowerShell profile recursive Registry Scripts security session share snapshots SQL Stat VI Toolkit VMware vSphere WMI WSUS ZenArchives
- July 2012
- July 2011
- February 2011
- January 2011
- December 2010
- May 2010
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
