Attempting to add a few ad-hoc users to PSU via the PSU Powershell Module and while I can create via New-PSUIdentity including the -Role parameter keeps giving me a cannot convert from System.String to PowerShellUniversal.Role"
Is there any documentation on this?
Recommended Answer
Attempting to add a few ad-hoc users to PSU via the PSU Powershell Module and while I can create via New-PSUIdentity including the -Role parameter keeps giving me a cannot convert from System.String to PowerShellUniversal.Role"
Is there any documentation on this?
We probably should improve this behavior to provide the role lookup automatically. That said, you will have to retrieve a role object and then pass it to the identity cmdlet.
$Role = Get-PSURole -Name "Administrator"
New-PSUIdentity -Name "Adam" -Role $RoleAdam Driscoll
PowerShell Expert and Software Architect at Devolutions
Attempting to add a few ad-hoc users to PSU via the PSU Powershell Module and while I can create via New-PSUIdentity including the -Role parameter keeps giving me a cannot convert from System.String to PowerShellUniversal.Role"
Is there any documentation on this?
We probably should improve this behavior to provide the role lookup automatically. That said, you will have to retrieve a role object and then pass it to the identity cmdlet.
$Role = Get-PSURole -Name "Administrator"
New-PSUIdentity -Name "Adam" -Role $RoleAdam Driscoll
PowerShell Expert and Software Architect at Devolutions
Attempting to add a few ad-hoc users to PSU via the PSU Powershell Module and while I can create via New-PSUIdentity including the -Role parameter keeps giving me a cannot convert from System.String to PowerShellUniversal.Role"
Is there any documentation on this?
We probably should improve this behavior to provide the role lookup automatically. That said, you will have to retrieve a role object and then pass it to the identity cmdlet.
$Role = Get-PSURole -Name "Administrator"
New-PSUIdentity -Name "Adam" -Role $Role
Thanks for the quick reply. This worked.