-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with Get-TssSecretAudit : Can't convert value to type "Thycotic.PowerShell.Secrets.Audit" #392
Comments
Having same problem. |
Same issue with PSVersion 7.4.2 Secret Server on-premises 11.7.000015
Also fails when omitting -IncludePasswordChangeLog
|
@jagger or @tylerezimmerman It looks like the issue is because https://github.com/thycotic-ps/thycotic.secretserver/blob/dev/src/Thycotic.SecretServer/classes/secrets/Audit.cs class does not have string |
Verified issue does not already exist?
Yes
What error did you receive
System.Management.Automation.RuntimeException: Cannot convert value "@{id=525028; dateRecorded=01/02/2024 18:35:46; action=VIEW; actionForDisplay=VIEW; notes=;
byUserDisplayName=Authentification User; ticketNumber=; recordingStatus=-1; recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=False;
username=Authentification User; application=SecretServerCloud}" to type "Thycotic.PowerShell.Secrets.Audit". Error: "Cannot convert the "@{id=525028;
dateRecorded=01/02/2024 18:35:46; action=VIEW; actionForDisplay=VIEW; notes=; byUserDisplayName=Authentification User; ticketNumber=; recordingStatus=-1;
recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=False; username=Authentification User; application=SecretServerCloud}"
value of type "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.Secrets.Audit"."
---> System.Management.Automation.PSInvalidCastException: Cannot convert value "@{id=525028; dateRecorded=01/02/2024 18:35:46; action=VIEW; actionForDisplay=VIEW; notes=;
byUserDisplayName=Authentification User; ticketNumber=; recordingStatus=-1; recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=False;
username=Authentification User; application=SecretServerCloud}" to type "Thycotic.PowerShell.Secrets.Audit". Error: "Cannot convert the "@{id=525028;
dateRecorded=01/02/2024 18:35:46; action=VIEW; actionForDisplay=VIEW; notes=; byUserDisplayName=Authentification User; ticketNumber=; recordingStatus=-1;
recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=False; username=Authentification User; application=SecretServerCloud}"
value of type "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.Secrets.Audit"."
---> System.Management.Automation.PSInvalidCastException: Cannot convert the "@{id=525028; dateRecorded=01/02/2024 18:35:46; action=VIEW; actionForDisplay=VIEW; notes=;
byUserDisplayName=User; ticketNumber=; recordingStatus=-1; recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=False;
username=Authentification User; application=SecretServerCloud}" value of type "System.Management.Automation.PSCustomObject" to type
"Thycotic.PowerShell.Secrets.Audit".
---> System.InvalidOperationException: The property 'application' was not found for the 'Thycotic.PowerShell.Secrets.Audit' object. The settable properties are: [SecretAuditId
<System.Int32>], [FullName <System.String>], [Action <System.String>], [ActionForDisplay <System.String>], [ByUserDisplayName <System.String>], [DatabaseName <System.String>], [DateRecorded
<System.Nullable
1[[System.DateTime, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]>], [HasProxySessionData <System.Boolean>], [Id <System.Int32>], [Notes <System.String>], [RecordingMessage <System.String>], [RecordingSessionId <System.String>], [RecordingStatus <System.Int32>], [Status <System.String>], [TicketNumber <System.String>], [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 ---
Please run the command using -Verbose
Get-TssSecretAudit -TssSession $session -Id 1115 -Verbose
VERBOSE: Command invocation: get-TssSecretAudit -TssSession:TssSessionObject -Id:System.Int32[] -Verbose:True
VERBOSE: Performing the operation GET https://x/api/v1/secrets/1115/audits?sortBy[0].direction=desc&sortBy[0].name=DateRecorded&take=2147483647
InvalidArgument: C:\PowerShell\Modules\Thycotic.SecretServer\0.61.8\functions\secrets\Get-TssSecretAudit.ps1:76:21
Line |
76 | … [Thycotic.PowerShell.Secrets.Audit[]]$restResponse.record …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert value "@{id=525028; dateRecorded=01/02/2024 18:35:46; action=VIEW; actionForDisplay=VIEW; notes=; byUserDisplayName=Authentification User; ticketNumber=; recordingStatus=-1;
| recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=False; username=Authentification User; application=SecretServerCloud}" to type
| "Thycotic.PowerShell.Secrets.Audit". Error: "Cannot convert the "@{id=525028; dateRecorded=01/02/2024 18:35:46; action=VIEW; actionForDisplay=VIEW; notes=; byUserDisplayName=Authentification User; ticketNumber=; recordingStatus=-1; recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=False; username=Authentification User;
| application=SecretServerCloud}" value of type "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.Secrets.Audit"."
Provide a test case or steps to reproduce
Get-TssSecretAudit -TssSession $session -Id 1115
Expected behavior
This should return the audit log of the secret but it is throwing a error while doing so.
What Edition of Secret Server?
Cloud Subscription
What version of Secret Server
Secret Server Cloud
What PowerShell host was used when producing this error
Windows PowerShell (powershell)
PowerShell Host Version
PSVersion 7.4.0
The text was updated successfully, but these errors were encountered: