pspete / psPAS

PowerShell module for CyberArk Privileged Access Security REST API
https://pspas.pspete.dev
MIT License
286 stars 90 forks source link

Error on Set-PASUser #539

Closed midiaxe closed 1 month ago

midiaxe commented 1 month ago

Describe the issue When running the Set-PASUser using the commands below, I get this error message. Command: Set-PASUser -id 1234 -UserName guest -NewPassword $securePWD -ChangePassOnNextLogon $true or Set-PASUser -id 1234 -UserName guest -NewPassword $securePWD

Error:

ConvertTo-UnixTime : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:44 char:65
+ ... ct['ExpiryDate'] = $UserProperties['ExpiryDate'] | ConvertTo-UnixTime
+                                                        ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (-62135575200:Int64) [ConvertTo-UnixTime], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,ConvertTo-UnixTime

To Reproduce Steps to reproduce the behavior:

  1. Run the command above

Expected behavior A clear and concise description of what you expected to happen.

Screenshots & Console Output If applicable, add screenshots and/or console output to help explain your problem.


ConvertTo-UnixTime : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:44 char:65
+ ... ct['ExpiryDate'] = $UserProperties['ExpiryDate'] | ConvertTo-UnixTime
+                                                        ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (-62135575200:Int64) [ConvertTo-UnixTime], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,ConvertTo-UnixTime

Your Environment

Additional context

pspete commented 1 month ago

Sounds similar to #536 - its next on my list to take a look at

midiaxe commented 1 month ago

Thanks!