Do you ever rename a server? Sure, in Windows that’s pretty easy. But having virtualized most of your servers, renaming brings along some new challenges.
When you first create a virtual machine, you enter a name for the machine. But that’s before you even started installing Windows on it. You might not even use the [...]
Helpful function of the day:
This one was requested by jfk8680 on the VMware Toolkit Community.
It allows you to change what happens when you press the power off button for a vm. It sets it to “soft” which means a gentle Guest OS Shutdown. Usage: Set-SoftPowerOff $VMs , where $VMs is a collection of one [...]
Today’s helpful scripts are ready to use scripts that generate an overview of your VM’s and your Datastores and save it to a HTML file. Great for reporting purposes. Easy to modify to meet your needs. Give them a try:
Get-DatastoreSizes (Rename to .ps1)
This one shows datastores with Used [...]
The following function uses the ADSI provider and some tricks to determine the members of the local Administrators group on any of your Windows Servers. Check it out:
function Get-LocalAdmins
{
param([string]$serverName)
$ErrorActionPreference = “Stop”
If ($serverName -eq “”)
{
Write-Host “Usage: Get-LocalAdmins “`
-ForegroundColor yellow
Until the powers of remoting arrive in Powershell v2, accessing a remote registry is a bit more cumbersome than a local registry. As you no doubt know, Powershell allows you to browse through the local registry as if it was a filesystem. The folling function should help you with accessing a [...]
Gathering all sorts of server information with Powershell is rather easy, using the Get-WmiObject cmdlet.
In order to get NIC settings, the following little script returns a LOT of information:
$serverName = Read-Host “Enter server name”
$NicConfig = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName $serverName
$NicConfig | Format-List *
The one thing I [...]
With the release of VI Toolkit v1.0, the bèta-cmdlet Get-VIServer has been renamed to Connect-VIServer, which more accurately describes the action. The opposite action is now also available in the form of Disconnect-VIServer. Every script you start with Connect-VIServer should end with Disconnect-VIServer if you’d like to keep the amount of open sessions [...]
VI Toolkit Product Manager Carter Shanklin pointed out in the VMware Communities that the script I posted yesterday can be significantly shortened. They have intrduced the shortcut:
Get-View ServiceInstance
So the script I posted yesterday can be reduced to:
$SI = Get-View ServiceInstance
$LicMan = Get-View $SI.Content.LicenseManager
$LicMan.Source.LicenseServer
Here’s [...]
I’ve got a powerfull snippet of code for you today! Sure, we’ve already had lot’s of fun using the VI Toolkit to find and manipulate all sort of settings. But do you know where to find the Virtual Center Server settings, which you access in the VI Client through the menu Administration -> [...]
Today’s oneliner is an incredibly fast way to check the usage of your VMware datastores. You should first connect to Virtual Center in the following way:
$VC = Connect-VIServer “YourVCServerName”
Here comes the oneliner:
Get-Datastore | Sort-Object Name | %{Get-View $_.Id} | Format-Table @{Label=”Name”;Expression={$_.info.name}}, @{Label=”NumVMs”;Expression={$_.vm.length}}
Only interested in datastores that are not used? [...]
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
