Virtu-Al.Net

Virtually everything is poshable

PowerCLI: vProfiles

Following my recent post, Easy vSwitch & PortGroup Setup I thought I would give PrimalForms a go and create a quick GUI, PrimalForms is a great app from Sapien which allows you create form based windows for which it gives you the PowerShell code, this means no install and yet the users still get a great looking GUI.

It turned out pretty good, even if I do say so myself.

Here’s what the script allows you to do:

  • Compares one host to another
  • Copies vSwitches if they do not currently exist
  • Copies PortGroups + VLAN Tags if they do not currently exist

What it doesn’t do at the moment is copy any of the custom settings for the vSwitches or PortGroups.

This is still very much a V1 and it will be added to, I hope to include other areas such as the NTP servers, advanced host configuration etc, if you have an idea then please add it to the comments and I will see what I can do.

To see this in action please check out the below video, this script can easily be run straight from the PowerCLI prompt also.

vProfiles from Alan Renouf on Vimeo.

To download the script check below:

, , ,

10 Responses to “PowerCLI: vProfiles”

  • kenny says:

    This is very awesome Alan. Fantastic work on this!!!

  • Virtu-Al says:

    Thanks Kenny, anything you think would be useful to add let me know !

    NTP
    Advanced Host settings
    ETC

  • Alex says:

    This would be beautiful:

    iSCSI enable and config
    Security Profile: NFS enable, NTP enable, SNMP and so on
    License Server Source: populate from source host
    DNS and Routing: populate domain and DNS servers from source host?

    alex AT myra.com

  • Virtu-Al says:

    @Alex
    All great ideas, getting excited about V2 now :)

  • Ken says:

    Alan,
    This script seems to mushroom cloud when run against vSphere. Are there any specific requirements?

  • Virtu-Al says:

    @Ken
    To be honest I didnt try it on vSphere but will do now, It should work, unless of course you are using dvSwitches !

  • Mark says:

    Hi Al, this doesn’t work for me (ESXi 3.5 & ESXi 4)…this is the error:

    Get-VirtualSwitch : Cannot validate argument on parameter ‘Name’. The argument
    is null or empty. Supply an argument that is not null or empty and then try the
    command again.

  • Ed Grigson says:

    Hi Al, like Mark I’m unable to run this against an ESX 4 update 1 host. It gives the error ‘The argument cannot be null or empty’ just after enumerating the virtual switches and trying to create the first portgroup. If I find time I’ll try to dig into the code myself but I’m no Virtu-Al!

  • Sead Latif says:

    Hi Al, this doesn’t work for me (ESXi 3.5 & ESXi 4)…this is the error:
    Get-VirtualSwitch : Cannot validate argument on parameter ‘Name’. The argument
    is null or empty. Supply an argument that is not null or empty and then try the
    command again.

    I had the same as above, removed the switches and re-run, it works OK. It seems that it does not like if you pre-create switches.

  • Chad King says:

    It wouldbe awesome if it did have dvswitch support – we have a mess of dvswitches and we have to consolidate a lot of things right now. Hopefully I can figure something out.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>