Don Jones Discusses PowerShell Parameters

Posted Posted in Development, Information Technology

Don Jones has a brief discussion on creating PowerShell Parameters.  PowerShell Parameters are used to pass inputs to your PowerShell scripts and functions. I’ve been helping more than a few folks unravel some grave misunderstandings. At first, I thought, “where in the world did they get this stuff,” and then I thought, “the Internet,” and it all made sense! When you’re trying to get a job done by piecing together things on the Internet, you run into several problems. First, not everyone on the Internet has actually got a clue. Second, sometimes they’re not clear why they did a certain […]

PowerCLI v5 Gotcha

Posted Posted in Information Technology, Virtualization

vExperienced.co.uk found a Gotcha with PowerCLI v5 – The guest OS configuration makes use of the ‘VMGuest’ family  of cmdlets; Invoke-VMScript Copy-VMGuestFile Get-VMGuest, Restart-VMGuest etc Unfortunately since upgrading to vSphere5 and PowerCLI v5 we’ve discovered that the guest OS cmdlets are NOT backwards compatible! This means if you upgrade to PowerCLI v5 but your hosts aren’t running ESXiv5 and more importantly the VMTools aren’t the most up to date version any calls using the v5 cmdlets (such as Invoke-VMGuest) will no longer work. (read more)

PowerShell – the reporting tool

Posted Posted in Information Technology

I think one of the most popular uses for PowerShell is as a reporting tool.  Alan Renouf’s VMware Daily report is one of the most comprehensive PowerShell/PowerCLI reports I have seen. Jeff Hicks has released his own daily report that he runs against his machines every day. My script, MorningReport.ps1, relies on WMI to gather a variety of system information. By default it connects to the local host, but I’ve provided a computername parameter. I’m assuming current credentials are good enough for any remote system, but you can always add support for alternate credentials, assuming I don’t in some future […]

PowerShell and Office 365

Posted Posted in Information Technology

New article on using PowerShell to automate Office 365 – There are actually two Powershell environments available to O365 administrators: 1. Microsoft Online Services Module for Windows PowerShell.  This environment, which is created and set up by a downloadable executable located here, provides PowerShell access to O365-specific components, such as licenses and user management features.  It also provides a set of Federation commands used when setting up Single Sign-On.  You can see the entire O365-specific command set by entering the following line after launching the MSOL Module shortcut: Get-Command *MSOL* 2. Remote Exchange Powershell.  The real powerhouse behind O365 Exchange […]

User Sessions and Idle times with PowerCLI

Posted Posted in Information Technology, Virtualization

Shogan.tech has a new post that includes a PowerShell/PowerCLI script that displays users who are logged in and how long they have been idle. Today I was looking into a small “nice to have” notification system for users that had left their vSphere clients open and logged into vCenter. I found this great bit of script to list currently logged in users over at blog.vmpros.nl and thought I would expand on this in my own way to generate a handy list of logged in users and their current idle time – similar to the way the “Sessions” tab in the vSphere client displays […]

PowerShell/PowerCLI to Find ESX Hosts Needing a Reboot

Posted Posted in Information Technology, Virtualization

From Rob van den Nieuwendijk – How to find VMware ESX(i) servers that need a reboot using PowerCLI.  Rob provides a PowerShell/PowerCLI one-liner If you install patches to your ESX(i) servers you will probably have to reboot them. But if you don’t reboot them right after installing the patches, how can you find the servers that are patched and waiting for a reboot? VMWare ESX(i) servers that are waiting for a reboot have the “Reboot Required” message in the Summary tab in the VMware vSphere Client. But if you have hundreds of ESX(i) servers, you don’t want to click through […]

Invoke-VMScript: Running PowerShell on a Remote VM

Posted Posted in Information Technology, Virtualization

PowerCLI guru Luk Dekens has a new post that discusses when you can use Invoke-VMScript to run a PowerShell script on a VMware virtual machine. The Invoke-VMScript cmdlet can be a very useful cmdlet, but sometimes it will fail against one or more of your VMs. And it is not always immediately clear why the Invoke-VMScript cmdlet will not work against that specific VM. The cmdlet help contains a number of prerequisites, but how do you verify if all the prerequisites are fulfilled? I decided to create a function that would verify the prerequisites, and that would, if requested, which […]