thycotic.secretserver icon indicating copy to clipboard operation
thycotic.secretserver copied to clipboard

Get-TssUserGroup - Error : Invalid Argument

Open apsyka93 opened this issue 11 months ago • 0 comments

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; [email protected]; 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; [email protected]; 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; [email protected];
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; [email protected]; 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; [email protected];
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<Process>, C:\Program Files\PowerShell\Modules\Thycotic.SecretServer\0.61.8\functions\users\Get-TssUserGroup.ps1: line 68 at <ScriptBlock>, <No file>: 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; [email protected]; 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; [email protected]; 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

apsyka93 avatar Feb 19 '25 16:02 apsyka93