Skip to content

Get-TssUserGroup - Error : Invalid Argument #417

@apsyka93

Description

@apsyka93

Verified issue does not already exist?

Yes

What error did you receive

PS C:\temp> $error[0] | select *

PSMessageDetails :
Exception : System.Management.Automation.RuntimeException: Cannot convert value "@{userId=3; userName=name@email.com;
displayName=; userDomainId=-1; userDomainName=; groupId=1; groupName=All Vault Users; groupDomainId=-1; groupDomainName=;
enabled=False; isPlatform=False; isEditable=False}" to type "Thycotic.PowerShell.Groups.UserSummary". Error: "Cannot convert the
"@{userId=3; userName=name@email.com; displayName=; userDomainId=-1; userDomainName=; groupId=1; groupName=All Vault
Users; groupDomainId=-1; groupDomainName=; enabled=False; isPlatform=False; isEditable=False}" value of type
"System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.Groups.UserSummary"."
---> System.Management.Automation.PSInvalidCastException: Cannot convert value "@{userId=3; userName=name@email.com;
displayName=; userDomainId=-1; userDomainName=; groupId=1; groupName=All Vault Users; groupDomainId=-1; groupDomainName=;
enabled=False; isPlatform=False; isEditable=False}" to type "Thycotic.PowerShell.Groups.UserSummary". Error: "Cannot convert the
"@{userId=3; userName=name@email.com; displayName=; userDomainId=-1; userDomainName=; groupId=1; groupName=All Vault
Users; groupDomainId=-1; groupDomainName=; enabled=False; isPlatform=False; isEditable=False}" value of type
"System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.Groups.UserSummary"."
---> System.Management.Automation.PSInvalidCastException: Cannot convert the "@{userId=3; userName=name@email.com;
displayName=; userDomainId=-1; userDomainName=; groupId=1; groupName=All Vault Users; groupDomainId=-1; groupDomainName=;
enabled=False; isPlatform=False; isEditable=False}" value of type "System.Management.Automation.PSCustomObject" to type
"Thycotic.PowerShell.Groups.UserSummary".
---> System.InvalidOperationException: The property 'isPlatform' was not found for the 'Thycotic.PowerShell.Groups.UserSummary'
object. The settable properties are: [DisplayName <System.String>], [Enabled <System.Boolean>], [GroupDomainId <System.Int32>],
[GroupDomainName <System.String>], [GroupId <System.Int32>], [GroupName <System.String>], [UserDomainId <System.Int32>],
[UserDomainName <System.String>], [UserId <System.Int32>], [Username <System.String>].
at System.Management.Automation.LanguagePrimitives.CreateMemberNotFoundError(PSObject pso, DictionaryEntry property, Type resultType)
at System.Management.Automation.LanguagePrimitives.SetObjectProperties(Object o, IDictionary properties, Type resultType,
MemberNotFoundError memberNotFoundErrorAction, MemberSetValueError memberSetValueErrorAction, Boolean enableMethodCall, IFormatProvider
formatProvider, Boolean recursion, Boolean ignoreUnknownMembers)
at System.Management.Automation.LanguagePrimitives.SetObjectProperties(Object o, PSObject psObject, Type resultType,
MemberNotFoundError memberNotFoundErrorAction, MemberSetValueError memberSetValueErrorAction, IFormatProvider formatProvider, Boolean
recursion, Boolean ignoreUnknownMembers)
--- End of inner exception stack trace ---
at System.Management.Automation.LanguagePrimitives.SetObjectProperties(Object o, PSObject psObject, Type resultType,
MemberNotFoundError memberNotFoundErrorAction, MemberSetValueError memberSetValueErrorAction, IFormatProvider formatProvider, Boolean
recursion, Boolean ignoreUnknownMembers)
at System.Management.Automation.LanguagePrimitives.ConvertViaNoArgumentConstructor.Convert(Object valueToConvert, Type resultType,
Boolean recursion, PSObject originalValueToConvert, IFormatProvider formatProvider, TypeTable backupTable, Boolean ignoreUnknownMembers)
--- End of inner exception stack trace ---
at System.Management.Automation.LanguagePrimitives.ConvertViaNoArgumentConstructor.Convert(Object valueToConvert, Type resultType,
Boolean recursion, PSObject originalValueToConvert, IFormatProvider formatProvider, TypeTable backupTable, Boolean ignoreUnknownMembers)
at System.Management.Automation.LanguagePrimitives.ConvertViaNoArgumentConstructor.Convert(Object valueToConvert, Type resultType,
Boolean recursion, PSObject originalValueToConvert, IFormatProvider formatProvider, TypeTable backupTable)
at System.Management.Automation.LanguagePrimitives.ConvertTo(Object valueToConvert, Type resultType, Boolean recursion,
IFormatProvider formatProvider, TypeTable backupTypeTable)
at System.Management.Automation.LanguagePrimitives.ConvertUnrelatedArrays(Object valueToConvert, Type resultType, Boolean recursion,
PSObject originalValueToConvert, IFormatProvider formatProvider, TypeTable backupTable)
at CallSite.Target(Closure, CallSite, Object)
at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
--- End of inner exception stack trace ---
TargetObject :
CategoryInfo : InvalidArgument: (:) [], RuntimeException
FullyQualifiedErrorId : InvalidCastConstructorException
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at Get-TssUserGroup, C:\Program Files\PowerShell\Modules\Thycotic.SecretServer\0.61.8\functions\users\Get-TssUserGroup.ps1:
line 68
at , : line 1
PipelineIterationInfo : {}

Please run the command using -Verbose

VERBOSE: Command invocation: Get-TssUserGroup -TssSession:TssSessionObject -Id:System.Int32[] -Verbose:True
VERBOSE: Performing the operation GET https://fdgroup.secretservercloud.eu/api/v1/users/3/groups?sortBy[0].direction=asc&sortBy[0].name=GroupId&take=2147483647
InvalidArgument: C:\Program Files\PowerShell\Modules\Thycotic.SecretServer\0.61.8\functions\users\Get-TssUserGroup.ps1:68:21
Line |
68 | … [Thycotic.PowerShell.Groups.UserSummary[]]$restREsponse.r …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert value "@{userId=3; userName=name@email.com; displayName=; userDomainId=-1; userDomainName=; groupId=1; groupName=All
| Vault Users; groupDomainId=-1; groupDomainName=; enabled=False; isPlatform=False; isEditable=False}" to type "Thycotic.PowerShell.Groups.UserSummary".
| Error: "Cannot convert the "@{userId=3; userName=name@email.com; displayName=; userDomainId=-1; userDomainName=; groupId=1;
| groupName=All Vault Users; groupDomainId=-1; groupDomainName=; enabled=False; isPlatform=False; isEditable=False}" value of type
| "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.Groups.UserSummary"."

Provide a test case or steps to reproduce

Just using the command Get-TssUserGroup -TssSession $session -Id gives an error

Expected behavior

Expected to get the groups of a user

What Edition of Secret Server?

Platinum

What version of Secret Server

Secret Server Cloud

What PowerShell host was used when producing this error

PowerShell Core (pwsh)

PowerShell Host Version

Name Value


PSVersion 7.4.0
PSEdition Core
GitCommitId 7.4.0
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage needednew issues that are still in state of triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions