Posts
Get-VIAllPrivileges
This is a good script to easily report on privileges and can easily be extended to audit against a known good list of expected roles/priveleges.
1 2 3 4 5 6 7 8 9 10 11 12 #Must already be connected to a viserver. This works on the default vi server. $si = Get-View ServiceInstance $am = Get-View ($si.Content.AuthorizationManager) foreach ($role in $am.RoleList) { foreach ($privilege in $role.Privilege) { $role| Select-Object RoleId, System, Name, @{Name="Privilege"; Expression={$privilege}} } }
Posts
VI Toolkit Install Script – PowerShell
Here is a script I wrote to install the VI Toolkit Extensions on my systems. The VITKE team decided to go with a cmd file in case PowerShell was not installed and I think that makes perfect sense. I am posting this code just in case it will be useful to someone else.
InstallVitkEextensions.ps1
Posts
Forwarding VMware logs to a syslog server using PowerShell
I am working on a PowerShell script to replace the functionality of the logging daemon in VIMA and am making some progress. Check out the scripts/programs page for updates. I have posted the code out there for sending syslog messages from PowerShell. There are some third party tools for this but I wanted the learning experience and I am cheap.
Posts
PowerShell: Custom Objects with Method Parameters
I was not sure how to add parameters to custom object methods, but it is pretty simple. Here is a simple example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Function CustomObjectWithMethodParameter { $CustomObject = New-Object PSObject $CustomObject | Add-Member -MemberType ScriptMethod -Name testParam -Value { param ( [String]$parameter01 = $(throw "parameter01 must be specified.") ) Write-Host "Parameter01 value: $parameter01" } $CustomObject } $myobj = CustomObjectWithMethodParameter $myobj.
Posts
New Scripts/Programs Page
I have added a new page that will be the central index to any scripts or programs that I develop. It is available on the front page menu bar and is creatively labeled Scripts/Programs.
I have started off with an updated version of my PowerShell ISE custom menu.
Posts
Plug for SAGE and USENIX
This is for the admins out there who have not heard of sage or Usenix or those that think that this is only for *nix people (Windows and VM admins).
I think that both of these groups are great and have memberships to both. They focus on issues that are important to IT professionals and provide a forum for a professional system administrator to learn and grow. Some topics have a *nix bias but beneath it all most of the current OSes are based on the same principles.
Posts
PowerShell: Get VMs running on a single host
I wanted to perform an action on all of the VMs on a particular host, but using my connection to Virtual Center instead of reconnecting directly to the host. I found something interesting.
This is wrong:
Get-VMhost esx1.local | Get-VM #Not what I expected. This does not work as I expected. It gets all of the VMs in the cluster instead of just the ones registered with the host. My best guess is that this is because the host is not really a container object when in a cluster.
Posts
Validating Ubuntu Installed Files
I had an issue where I ran a vendor provided install script and my kernel sound drivers were deleted. I recovered them just fine, but it had me wondering about how I could be sure that no other files were missing or corrupted.
After some searching online I found a reference to someone checking a package using dpkg’s md5sums. This and some poking around gave me what I needed.
cd / sudo /usr/bin/md5sum -c /var/lib/dpkg/info/*.
Posts
PowerShell ISE Custom Menu
Here is some code that I am working on for customizing the PowerShell ISE to do some things that I would like it to do.
`Update 1/22/2009: After switching to a full WordPress install I don’t have a problem uploading code files any more. Keep any eye on this pagefor any updates to the custom ISE menu. Feedback is welcomed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 # # Add Run with arguments capability # $psise.
Posts
System Administration Podcast
This looks like it might be an interesting development – a system admin podcast. The first one covers some substantial topics and I look forward to more.
http://cuddletech.com/blog/pivot/entry.php?id=964
Posts
Package error with HP RDP and ESX 3.5 Update 1
The scripted install fails and the installer reports that it can not find some package files. The files were extracted from an ISO that was verified using md5sum.
When I extracted the files from the ISO image using MagicISO or DaemonTools on Windows a few of the files have invalid names. It looks just fine when I mount the ISO in my Ubuntu Linux VM though. I burnt the ISO to a disk and the same files have incorrect names.
Posts
VC Upgrade to 2.5 and XP template issues
We upgraded to Virtual Center 2.5 and our XP deployments failed to join the domain. When I logged onto the VM I received a popup about an unsigned driver issue for the network card. Turns out a patch to the network driver in ESX 3.0.1 updated the driver to version 2.0.0.9 and there was a version of it in C:\WINDOWS\system32\ReinstallBackups. ESX 3.0.2 has a version of 2.0.0.8 so it looks like the problem was resolved within ESX itself.