VMware

setUserDatastorePermission.pl

VERSION 3 Published

Created on: Oct 7, 2009 9:06 PM by lamw - Last Modified:  Nov 19, 2009 9:42 AM by lamw

This script will apply a permission which contains a username and role to a specific datastore.

Requirements:
vCenter 4.0
ESX(i) 3.5 or 4.0
vSphere SDK for Perl or vMA 4.0

Default roles in vCenter (you can use your own):
NoAccess
Anonymous
View
ReadOnly
Admin
VirtualMachinePowerUser
VirtualMachineUser
ResourcePoolAdministrator
VMwareConsolidatedBackupUser
DatastoreConsumer
NetworkConsumer

Sample Execution:

[vi-admin@scofield ~]$ ./setUserDatastorePermission.pl --server reflex.primp-industries.com --username primp --datastore himalaya-iSCSI-starwind.esx-devCluster --user williamlam --rolename DatastoreConsumer
Searching for rolename: DatastoreConsumer...
Applying role: "DatastoreConsumer" to user: "williamlam" on datastore: "himalaya-iSCSI-starwind.esx-devCluster"


Attachments:
Average User Rating
(0 ratings)




Comments

Nov 19, 2009 8:24 AM Doug Clark  VMware  says:

Note that this script won't work on vCenter 2.5 because that version did not support assigning permissions on Datastore objects.

Nov 19, 2009 9:42 AM lamw  says: in response to: Doug Clark

Thanks for the info, I'll update the doc to reflect this.


=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/
Twitter: @lamw
vGhetto Script Repository
Getting Started with the vMA (tips/tricks)
Getting Started with the vSphere SDK for Perl
VMware Code Central - Scripts/Sample code for Developers and Administrators
VMware Developer Comuunity

http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg

If you find this information useful, please award points for "correct" or "helpful".

 

Developer Social Media

Communities