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

Search-TssFolderPermission not converting resulting PSCustomObject to Thycotic.PowerShell.FolderPermissions.Permission

Open ciokthisout opened this issue 1 year ago • 1 comments

Verified issue does not already exist?

Yes

What error did you receive

Cannot convert value "@{id=566; folderId=118; groupId=6; groupName=; userId=6; userName=account; folderAccessRoleId=10; folderAccessRoleName=Owner; secretAccessRoleId=11; secretAccessRoleName=Owner; knownAs=account; domainName=}" to type "Thycotic.PowerShell.FolderPermissions.Permission". Error: "Cannot convert the "@{id=566; folderId=118; groupId=6; groupName=; userId=6; userName=account; folderAccessRoleId=10; folderAccessRoleName=Owner; secretAccessRoleId=11; secretAccessRoleName=Owner; knownAs=account; domainName=}" value of type "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.FolderPermissions.Permission"."

Please run the command using -Verbose

Search-TssFolderPermission -TssSession $session -FolderId 118 -verbose VERBOSE: Command invocation: Search-TssFolderPermission -TssSession:TssSessionObject -FolderId:TssSessionObject -Verbose:True VERBOSE: Filters: filter.folderId=22 VERBOSE: Performing the operation GET https://org.secretservercloud.com/api/v1/folder-permissions?sortBy[0].direction=asc&sortBy[0].name=Id&take=2147483647&f ilter.folderId=22 Cannot convert value "@{id=54; folderId=22; groupId=6; groupName=; userId=6; userName=account; folderAccessRoleId=10; folderAccessRoleName=Owner; secretAccessRoleId=11; secretAccessRoleName=Owner; knownAs=account; domainName=}" to type "Thycotic.PowerShell.FolderPermissions.Permission". Error: "Cannot convert the "@{id=54; folderId=22; groupId=6; groupName=; userId=6; userName=account; folderAccessRoleId=10; folderAccessRoleName=Owner; secretAccessRoleId=11; secretAccessRoleName=Owner; knownAs=account; domainName=}" value of type "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.FolderPermissions.Permission"." At C:\Program Files\WindowsPowerShell\Modules\Thycotic.SecretServer\functions\folder-permissions\Search-TssFolderPermission.ps1:94 char:21

  • ... [Thycotic.PowerShell.FolderPermissions.Permission[]]$rest ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvalidCastConstructorException

Provide a test case or steps to reproduce

Search-TssFolderPermission -TssSession $session -FolderId 22

Expected behavior

When we had originally modified our script to perform this search (around May 2023), we were successfully getting the information back. At the time we were on v0.60.9. We tried updating to 61.0 and get the same result. Running the module on 61.1 and higher works fine, but requires PS 7+. We are triggering this script from a Secret Server pipeline and per Delinea support, invoking a script in PS 7 is not current supported from the UI. This is not a process we are going to run directly on an endpoint.

What Edition of Secret Server?

Platinum

What version of Secret Server

Secret Server Cloud

What PowerShell host was used when producing this error

Windows PowerShell (powershell)

PowerShell Host Version

5.1.20348.2110

ciokthisout avatar Jan 04 '24 15:01 ciokthisout

Issue is resolved on current release.

This is a request to return to powershell 5 compatibility so the module can be called from within secret server again.

jagger avatar Jan 05 '24 03:01 jagger