setUserDatastorePermission.pl

Version 3

    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"