[07-25-20 12:08:45 AM] PS: One or more errors occurred.
[07-25-20 12:09:00 AM] PS: Cannot bind parameter ‘Identity’. Cannot convert the “yann” value of type “System.String” to type “UniversalAutomation.Identity”.
[07-25-20 12:09:00 AM] PS: Cannot bind argument to parameter ‘Id’ because it is null.
[07-25-20 12:09:00 AM] PS: Cannot bind argument to parameter ‘JobId’ because it is null.
Before asking, i’ve tried to do it manually and get same errors.
I succeed in reproducing the error this way :
[UniversalAutomation.Identity]$Test = "test"
Cannot convert the "test" value of type "System.String" to type "UniversalAutomation.Identity".
At line:1 char:1
+ [UniversalAutomation.Identity]$Test = "test"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (:) [], ArgumentTransformationMetadataException
+ FullyQualifiedErrorId : RuntimeException
It seems that i’m stuck with a $Identity variable that must be provided under [UniversalAutomation.Identity] type instead of [String].
Hey again yann,
I’m not a user of universal automation but i’ll try help out where I can.
It looks to me like you’re trying to pass a string “test” into a universalautomation.identity type which is required instead.
This may not be the best page, but i couldnt find any info on the identity class within the universal docs: https://ironmansoftware.com/role-based-access-controls-in-universal-automation/
Looks like there is both commands to create this type of object:
$Identity = Get-UAIdentity -Name $UserName
$Identity = New-UAIdentity -Name Jeff -Role $Role
Hopefully this will point you in the right direction.
Very interesting !
In my case, the submitted New-UDTextBox is to Get-ADUser in ActiveDirectory and Set-ADUser to modify user’s password.
I set up a service account and use his token when i invoke or get the script Reset Password.ps1 with : -AppToken $Token
I tried to launch directly the script via Admin web interface and RunAs the service account : Success !
Do i need and how can i Run script As the service account if the Token isn’t enough ?
[08-03-20 11:42:46 PM] PS: One or more errors occurred.
[08-03-20 11:42:54 PM] PS: Cannot bind parameter 'Identity'. Cannot convert the "yann" value of type "System.String" to type "UniversalAutomation.Identity".
[08-03-20 11:42:54 PM] PS: Cannot bind argument to parameter 'Id' because it is null.
[08-03-20 11:42:54 PM] PS: Cannot bind argument to parameter 'JobId' because it is null.
[08-03-20 11:43:01 PM] PS: Call failed with status code 401 (Unauthorized): GET http://localhost:5000/api/v1/Script/User%20Report.ps1