Trying to add a Role for a VApp/VM for an existing user. In this situation, the UserName has a space in it.
In VCenter I selected the VApp -> Permissions -> Add
In the Add Permissions dialog, I select the AD Domain, Select the User from the drop down list and Role also from the list.
VCenter reports User or group named "User Name" does not exist.
I also tried it with New-VIPermission trying to set permission to a folder.and received the same error.
$Folder = New-Folder -Name "User Name" -Location $Parent
$VIAccount = Get-VIAccount -user "User Name" -domain "MYDOM"
$Role = Get-VIRole -Name "UserRole"
$Folder | new-vipermission -Role $Role -Principal $VIAccount -Propagate:$True
It all seems to stem from the USERNAME because there is a literal SPACE in the name "User Name"
Error Message is identified from the "New-VIPermission" cmdlet and it reports "Unable to find user or group named 'User Name'"