VMware {code} Community
jumsky79
Contributor
Contributor

How to make Perl that gives the permission of each VM

Please teach how to make Perl that gives the permission of each machine.

I want to execute the following in the script.

==========================================

 1. make user

   →User-A, User-B (vicfg-user)

 2. make role

   → Role-A,Role-B( createRole.pl)

 3.set permission for the user

  → set Role-A for the User-A

  set Role-B for the User-B

 4.Update user permission in each VM

・Before

・VM-1

・root(Administrator)

・vpxuser(Administrator)

・User-A(Role-A)

・User-B(Role-B)

  ・VM-2

・root(Administrator)

・vpxuser(Administrator)

・User-A(Role-A)

・User-B(Role-B)

○After update

・VM-1

・root(Administrator)

・vpxuser(Administrator)

・User-A(Role-A)

・User-B(No-Access)

・VM-2

・root(Administrator)

・vpxuser(Administrator)

・User-A(No-Access)

・User-B(Role-B)

==========================================

I made Perl script from 1 to 3.

but I can't make Perl script(4).

I want to update user permission in each VM

Any help is greatly appreciated!

Reply
0 Kudos
2 Replies
lamw
Community Manager
Community Manager

You should be able to just use SetEntityPermissions and just specify the VM object and permissions you want to update/apply.

It might also be eaiser to do this via the VM folders/templates and set the permission at the root folder and then any VMs that are under that folder will have the parent permissions. This might be easier versus setting the permission for each and every VM

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

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

Reply
0 Kudos
jumsky79
Contributor
Contributor

Thank you advice.

I can update user permission in each ResorcePool

Reply
0 Kudos