We have a email passcode workflow utilizing the $global.GeneratePasscode() method to generate a passcode for user authentication in the Forget Password workflow. However, after upgrading to 5.15.1, the following exception is thrown:
QPM.Service.Modules.Extensibility.dll DefaultPsHostUserInterface.WriteErrorLine() >> PowerShell>> | Method invocation failed because [QPM.Service.Modules.Extensibility.PowerShell.Global] does not contain a method named 'GeneratePasscode'
The following steps reproduce the issue:
Status:
The Password Manager product team has raised defect #650530 to include a fix for this issue in a future version of Password Manager.
Workaround1:
function GeneratePasscode([int]$length) {
$chars = '0123456789'.ToCharArray()
$bytes = [byte[]]::new($length * 8)
$rng = [System.Security.Cryptography.RandomNumberGenerator]::Create()
try { $rng.GetBytes($bytes) }
finally { $rng.Dispose() }
$result = [char[]]::new($length)
for ($i = 0; $i -lt $length; $i++) {
[uint64]$value = [System.BitConverter]::ToUInt64($bytes, $i * 8)
$result[$i] = $chars[$value % 10]
}
return [string]::new($result)
}
Usage:
-copy and paste the code into the custom activity
-call the method: GeneratePasscode(8)
Example:
function PreExecuting($workflow, $activity)
{
$randompass = GeneratePasscode(8)
$randompass | Out-File -FilePath E:\PM_Temp\Passcode.txt -Append
}
Workaround2:
Use function Get-Random instead:
(Get-Random -Minimum 1000 -Maximum 9999).ToString()
Note: this method generates numbers only.
© 2026 One Identity LLC. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center