Automation

 View Only
  • 1.  Domain user to vCenter

    Posted Nov 15, 2023 05:09 PM

    Hello,

    Is there any script that I can find to add multiple domain users to the vCenter as a role of Administrator? Gone through multiple online suggestions and none of them are working.



  • 2.  RE: Domain user to vCenter

    Posted Nov 15, 2023 05:38 PM

    Provided you added the AD as an Identity Source to the VCSA, and provided you are not talking about Global Permissions, you should be able to do



  • 3.  RE: Domain user to vCenter

    Posted Nov 15, 2023 05:52 PM

    Thank you. It is working for a single domain account. But how can I add multiple domain account?
    I am getting error if I mention like this:
    $user = 'domain\user', 'domain\user1', 'domain\user2'

    NeenaJim_0-1700070805416.png

     



  • 4.  RE: Domain user to vCenter
    Best Answer

    Posted Nov 15, 2023 06:22 PM

    The Principal parameter only accepts a single value.
    You will have to use a loop to add multiple



  • 5.  RE: Domain user to vCenter

    Posted Nov 15, 2023 06:44 PM

    Thank you, that works perfect!

    Last question, is it possible that we can add this as Global permission? 



  • 6.  RE: Domain user to vCenter

    Posted Nov 15, 2023 06:52 PM

    Nothing official I'm afraid, but William wrote a script that uses the MOB to create such permissions.
    Have a look at Automating vSphere Global Permissions with PowerCLI (williamlam.com)



  • 7.  RE: Domain user to vCenter

    Posted Nov 15, 2023 08:39 PM

    Thank you so much again!