Open apsyka93 opened 9 months ago
Having same problem. PSVersion: 7.4.3 Module version: 0.61.8
Same issue with PSVersion 7.4.2 Module version: 0.61.8
Secret Server on-premises 11.7.000015
Command invocation: Get-TssSecretAudit -TssSession:TssSessionObject -Id:System.Int32[] -IncludePasswordChangeLog:True -Verbose:True Performing the operation GET https://x/api/v1/secrets/95603/audits?sortBy[0].direction=desc&sortBy[0].name=DateRecorded&take=2147483647&filter.includePasswordChangeLog=True InvalidArgument: C:\Users\me\Documents\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=2643635; dateRecorded=5/24/2024 3:01:29 AM; action=FIELDS DECRYPTED; actionForDisplay=FIELDS DECRYPTED; notes=Scope; byUserDisplayName=ThycoticSystem; | ticketNumber=; recordingStatus=-1; recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=; username=ThycoticSystem; application=}" to type | "Thycotic.PowerShell.Secrets.Audit". Error: "Cannot convert the "@{id=2643635; dateRecorded=5/24/2024 3:01:29 AM; action=FIELDS DECRYPTED; actionForDisplay=FIELDS DECRYPTED; | notes=Scope; byUserDisplayName=ThycoticSystem; ticketNumber=; recordingStatus=-1; recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=; | username=ThycoticSystem; application=}" value of type "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.Secrets.Audit"."
Also fails when omitting -IncludePasswordChangeLog
Command invocation: Get-TssSecretAudit -TssSession:TssSessionObject -Id:System.Int32[] -Verbose:True Performing the operation GET https://x/api/v1/secrets/95603/audits?sortBy[0].direction=desc&sortBy[0].name=DateRecorded&take=2147483647 InvalidArgument: C:\Users\me\Documents\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=2643635; dateRecorded=5/24/2024 3:01:29 AM; action=FIELDS DECRYPTED; actionForDisplay=FIELDS DECRYPTED; notes=Scope; byUserDisplayName=ThycoticSystem; | ticketNumber=; recordingStatus=-1; recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=; username=ThycoticSystem; application=}" to type | "Thycotic.PowerShell.Secrets.Audit". Error: "Cannot convert the "@{id=2643635; dateRecorded=5/24/2024 3:01:29 AM; action=FIELDS DECRYPTED; actionForDisplay=FIELDS DECRYPTED; | notes=Scope; byUserDisplayName=ThycoticSystem; ticketNumber=; recordingStatus=-1; recordingSessionId=; recordingMessage=; databaseName=; status=; hasProxySessionData=; | username=ThycoticSystem; application=}" value of type "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.Secrets.Audit"."
@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 application
which the API returns in the records of a secret audit. Should be an easy fix.
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