Add Vmx Path to VI Client using Powershell

The following script is a request from David Gontie, who was kind enough to comment on a previous post.

He’d like to add the location of his vm’s to a custom field. This is especially handy if you store all the files for a vm in a single datastore.

Here you go David:

Continue reading “Add Vmx Path to VI Client using Powershell”

Set VMware Snapshot Location with Powershell

Snapshots are m*th3rfcukers. If you’re not careful, they will mass-murder your vms. Yet they allow you to time-travel! You want to use them, but how to prevent a massacre? Here’s how: relocate the delta files.

When you create a snapshot, the current state of the vm is preserved by leaving the disk files alone. All changes since the moment of creating the snapshot are written to delta files. The delta files are stored in the vm’s working directory. The working directory is – by default – the location where the vmx and other config files reside. If that datastore runs out of free space – especially if it also contains disk files – you’re in a bit of a kerfuffle. Vms not booting or being frozen as if they stared into Medusa’s reptoid eyes.

So you can do two things: reserve overhead in your datastores and stay afraid some overactive snapshot might destroy your environment, or set the working directory of your vms to some big-ass datastore you don’t use for anything else and let the snapshots enjoy themselves. If they fill up the datastore, they only kill all vms with snapshots, not the rest.

But how, you ask? You can edit the vmx files of you vms manually – which requires your vms to be powered down – and add the line: workingDir = “/vmfs/volumes/<insanely long guid you need to somehow find>/”

Or, you run my script and change the working location on the fly:

Continue reading “Set VMware Snapshot Location with Powershell”

User Confirmation in Powershell

Built-in cmdlets usually offer the -Confirm parameter whenever you need user confirmation. When writing your own scripts, you might want to ask the eventual user of the script for confirmation yourself. This handy little function (store it in your profile!) allows you to ask for confirmation whenever, where-ever. (Try not to bug your users too much.)

Continue reading “User Confirmation in Powershell”

Create a vSwitch Port Overview with Powershell

WARNING: VMware vmotion does not check wether there are sufficient ports available on the virtual switch on the destination host. Migrating a vm to a host with insufficient ports will cause the vmotion to complete without warnings, yet the virtual NIC will be disconnected! This issue is descripbed in this KB article.
The solution to this problem is to create vSwitches with sufficient ports, obviously. Do you want to know how many ports are currently being used on every vSwitch in your environment? vSphere PowerCLI to the rescue! Try the following script:

Continue reading “Create a vSwitch Port Overview with Powershell”

Examine VMware CPU Ready Times with Powershell

When your (VMware) consolidation ratios are becoming high, it might be smart to keep an eye on your vm’s CPU Ready Times. Unfortunately, by default, the VI Client will only show realtime ready time statistics. Plus you’d have to look at each vm individually. Thank God VMware for the PowerCLI! Read this document for more information on how to interpret the results.

Continue reading “Examine VMware CPU Ready Times with Powershell”

Managing Scheduled Tasks Remotely Using Powershell

The following Powershell functions allow you to manage querying, creating and removing scheduled tasks on one or more computers remotely.
The functions use schtasks.exe, which is included in Windows. Unlike the Win32_ScheduledJob WMI class, the schtasks online crestor.exe commandline tool will show manually created tasks, as well as script-created ones. The examples show some, but not all parameters in action. I think the parameter names are descriptive enough to figure it out, really. If not, take a look at schtasks.exe /?. One tip: try piping a list of computer names to foreach-object and into this function.

Continue reading “Managing Scheduled Tasks Remotely Using Powershell”

Get SQL database size using Windows Powershell

The following script examines servers from (part of) your Active Directory domain, identifies SQL servers and lists the instances with their total database sizes.

Continue reading “Get SQL database size using Windows Powershell”

Oneliner: Service Console IP with PowerCLI

Getting the Service Console IP addresses of your ESX servers with vSphere PowerCLI (formerly known as the VI Toolkit for Powershell):

Get-VMHost | Select Name, @{N="ConsoleIP";E={(Get-VMHostNetwork).ConsoleNic | ForEach{$_.IP}}}
The ACL Cheap Oakleys Sale affects performance for most popular sports, and if you Cheap nfl jerseys torn the ligament in a knee, you need to have it repaired and rehabilitated before you can compete. This system is relatively easy and with a minimal amount of practice you will be ready to play for real. Get involved with coaching as soon as possible. O said health will be a factor, of course, but also who able to take the reps during practice this week. And a part of pop culture.. Each day we’ll add something new to it.. Fans now expect to have their bags searched and examined with metal detecting hand wands whenever they enter a venue.. “If he [James] had a new car and he pranged it, he would just go and buy a new car so there were five cars parked in the drive. Amazingly, most people use this secret hidden talent every day of their lives but they do not realize that they could actually get paid for it. At peace.. Fake Oakley Sunglasses We also are working hard to capture what we view as an untapped e commerce opportunity. You can join a league and get a NASCAR ball, an NFL ball, a SHREK ball and the list goes on and on. So what’s the problem? For starters, www.buyoakleysunglasses.com the type of asbestos that was typically found in schools, including those in New York City, was not the monster under the bed type that tends to kill people. Work in this role for a few years to gain the experience you need to become a head coach.. Former USC star Reggie Bush was inactive last week. BLACKISTONE: Exactly. 9. When you want to know what is going on in http://www.cheapnfljerseysx.com a live football match, but simply can’t watch the game yourself, then you will want to have access to live match scores online. This is a unique population of strength trained individuals who are required to have a higher body mass for competitive purposes. That not so strange or odd, but how it came to me was: I actually smelled and saw a fish, a shark, in a coffin with the son. It turns out that Oher, well below average in standard measures of cognition, scores very high in protective instincts.. However, at a sufficiently high T7 RNAP translation rate, the output module’s expression level would be high regardless of the priming promoter’s transcription rate. Coming back from Cheap Jerseys from china a torn ACL in his right knee, Charles never really caught fire in the offense. All patients have been screened for human T cell leukemia virus 1 status, and they are negative. One more time here we go. There is a lot of room for the company to alter its capital allocation a huge chunk of cash goes to the share repurchases, which can be diverted towards the dividend payments as well as capital expenditures cheap oakleys if need be.

Synchronize WSUS with Powershell

Yesterday, I showed you how to script the WSUS Cleanup Wizard with Powershell. Today, the WSUS fun continues! Here’s how to use powershell to “manually” synchronize your WSUS server, i.e. download the latest updates.

Continue reading “Synchronize WSUS with Powershell”

WSUS Cleanup with Powershell

If you manage a Windows Server Update Services (WSUS) server, you probably run the Server Cleanup Wizard every once and a while. It removes old and superseded updates and computers that haven’t reported their status for more than 30 days. Wouldn’t it be nice to schedule such a cleanup to run every month? Too bad there’s no command line tool I know of that can help you out with this. Powershell to the rescue!
Powershell can not only run the built-in commandlets or even those added by snapins. It can leverage the full power of the .NET Framework. Browse the MSDN Library if you want to find more cool things you can do with it. Here’s a script that uses this information to run the cleanup wizard:

Continue reading “WSUS Cleanup with Powershell”