RHEV: Can't attach user to a vm with Powershell API

Solution Verified - Updated -

Issue

  • Cannot attach user to RHEV VM using Powershel API.
  • Can successfully do the same using Admin Portal.
  • Powershell error:

PS C:\scripts> select-User -SearchText "myUser" -AD
      UserId     : 0223a732-a7ad-46f6-b895-0d68a1a92d45
      Department :
      Domain     : ADDOMAIN
      ...
PS C:\scripts> Add-User -UserId 0223a732-a7ad-46f6-b895-0d68a1a92d45 -UserRoleId 00000000-0000-0000-0001-000000000001
      Add-User : Cannot find user with id 0223a732-a7ad-46f6-b895-0d68a1a92d45
      At line:1 char:9
      + Add-User <<<<  -UserId 0223a732-a7ad-46f6-b895-0d68a1a92d45 -UserRoleId 00000000-0000-0000-0001-000000000001 -Domain ADDOMAIN
          + CategoryInfo          : InvalidArgument: (:) [Add-User], ArgumentExcepti
              on
           + FullyQualifiedErrorId : UnableToAddUser,RhevmCmd.PSCmdlet_Add_User

Environment

Red Hat Enterprise Virtualization Manager (RHEV-M) 2.2.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.