Thursday, 28 May 2009

Disconnected templates in VMware ESX

I had an issue today where the templates I wanted to deploy a VM from were listed as disconnected in VirtualCenter. They were displayed in italics, such as:

vmtemplatename (Disconnected)

This also meant that couldn't be converted into, or deployed as VMs. To resolve this issue I simply restarted the VirtualCenter service and the problem was resolved.

Thursday, 14 May 2009

Powershell

Powershell is something I've not really had much cause to use so far - I know, I know, it is really useful and a great way to script things - but with our network being relatively small I still find it most convenient to use the GUIs for most purposes.

However I have just discovered that Quest have some great free tools for Powershell. One is their ActiveRoles Management Shell which is a set of Powershell cmdlets specifically for managing Active Directory. I used this for a task I had which would have taken forever using the GUI — listing and exporting the contents of AD user groups. I just needed to write a simple script which queried the groups and piped the contents into a text file, using this command as shown below:
get-qadgroupmember -identity "usergroup name" >> userlist.txt
Easy.

The next tool, PowerGUI, basically provides a full GUI for Powershell cmdlets. The beauty of this is that you can use Powershell functionality even if you don't know the syntax of the cmdlets. You can use it just as a standard console or there is an editor where you can create your own scripts. The script editor is clever as it provides you with a list of valid options when you start entering the command, similar to how the Powershell command line can be prompted, however it displays it as you type so it saves on keystrokes. Sorry for the quality of the image below but hopefully you get the idea.



PowerGUI also integrates with VMware and Exchange 2007 if you have the Powershall management tools for those.

I'll certainly be useing Powershell more in future now.

Wednesday, 13 May 2009

Setting file permissions from command line in Windows 2000/2003

Microsoft provide a tool for this purpose called xcacls.exe which is part of the Windows 2000 Resource Kit or Windows 2003 Support Tools (Adminpak).

Briefly, say you wanted to set the permissisons on a group of files so that 'Everyone' has Full Control, you would issue the following command:
xcacls *.* /E /C /G everyone:F
To view the permissions on a single file you could just use:
xcacls filename.txt
More information can be found at http://support.microsoft.com/kb/318754