VMware Cloud Community
ITExpert9
Contributor
Contributor
Jump to solution

How to change a Role with PowerCLI in vCenter

I would like to change a user's role to "NoAccess" using PowerCLI. I've already checked developer.vmware.com and found the Set-VIRole command, but I'm having trouble getting it to work.

This was my idea:

Set-VIRole -Role (Get-VIRole -Name "NoAccess") -Principal "NameOfUser"

I based my approach on the following table:

 

 

 

Labels (1)
Reply
0 Kudos
2 Solutions

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The Set-VIRole cmdlet does not have a Principal parameter.
The Principal parameter is used with the New-VIPermission cmdlet when you assign a Role to a user/group on a specific inventory object.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Tags (1)
Reply
0 Kudos
ITExpert9
Contributor
Contributor
Jump to solution

The command allows you to change a user's role: 

    1

New-VIPermission -Role NameOfTheRole -Principal NameOfUser -Entity (Get-Datacenter)

 

 

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

The Set-VIRole cmdlet does not have a Principal parameter.
The Principal parameter is used with the New-VIPermission cmdlet when you assign a Role to a user/group on a specific inventory object.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Tags (1)
Reply
0 Kudos
ITExpert9
Contributor
Contributor
Jump to solution

The command allows you to change a user's role: 

    1

New-VIPermission -Role NameOfTheRole -Principal NameOfUser -Entity (Get-Datacenter)

 

 

Reply
0 Kudos