Power CLI commands

Getting the vCenter Roles

#Disable Customer Expierence Improvment Program 
Set-Powercliconfiguration -scope User -ParticipateInCeip $false
#Disable Invalid Certificate 
Set-powercliconfiguration -InvalidCertificateAction Ignore -Confirm:$false

connect-viserver -server 192.168.58.13

Get-VIrole "Readonly"
$Datacenter = "Plattform"
$Role = "Admin"
New-VIRole -Name "JP_Role" -Privilege (Get-VIPrivilege
New-VIPermission -Entity $Datacenter -Principal "vsphere.local\h1t3ch" -role $role -Propagate:$true|Out-Null
Set-VIRole -Role Role -AddPrivilege (Get-VIPrivilege -Name 'Create Datacenter')

Get-VIprivilege 

Get-ViRole -Name "JP_Role" | Remove-VIRole -confirm:$false
New-VIPermission -Entity (Get-Datacenter $datacenter) -Principal (Get-VIAccount -Domain $domain -Group|Where-Object {$_.Name -like "*$group*"}) -Role (Get-VIRole $role) -Propagate:$true|Out-Null

disconnect-viserver -server 192.168.58.13 -confirm:$false

Mac address change

#Gets network adapter from vm and sets the mac address to automatic generated mac address
$vm = get-vm lubuntu
$nic = get-networkadapter $vm
$nic.ExtensionData.AddressType = "Generated"
$nic.ExtensionData.MacAddress = ""
Set-NetworkAdapter $nic -confirm:$false