A recent request came through to assist with the post build procedures of a large ESX and vCenter rollout. One task was to remove the manual effort to create and assign the Roles and Permissions within vCenter.

After sifting through my pile of scripts I took to the web and headed straight for Alan Renouf’s website http://www.virtu-al.net/ . As you would expect there was an example originally instigated from a community discussion, the exact page is here, http://www.virtu-al.net/2009/06/15/vsphere-permissions-export-import-part-1/

I extracted the code but couldn’t actually get it going due a syntax error message which I didn’t understand (I admit I’m a novice at scripting). Not wanting to be beaten I took to the web again and posted within the VMware PowerCLI forum, original post here http://communities.vmware.com/thread/280803?tstart=15 . Another scripting guru leapt to save the day, Luc Dekens (his website http://www.lucd.info/ is packed full of useful information too).

Luc’s explanation (in the forum thread) and minor amendment brought the script to life.

I take no credit for the work here but I find the scripts incredibly useful.

Files can be downloaded here: EXPORT  IMPORT

(Updated) - Menu selection

Here’s an additional import script that displays a list of options to allow for imports in a multi-vCenter mixed environment.

Import Options

Import Options

File can be downloaded here IMPORT2

4 Responses to “vCenter Roles & Permissions Export / Import scripts”

  1. Cheers Dazzo

    That saved me an afternoon of tedium.

    -S

  2. Three cheers to Alan, LucD and Darren, these still work in 5.1.

  3. Thanks for updating this post, hadn’t yet needed to run this against 5 or 5.1, so your feedback is well received.

    Cheers, Darren.

  4. Perfect,, just what I wanted on a Friday afternoon. A PM just asked me to export the vCenter permissions so we can import it to the new ESXI 5.1 infrastructure. Cheers all.

Leave a Reply