Can someone tell me how to use this in a PowerShell Custom workflow?

I have all i need to send a random passcode from the SDK example although I don't know how to force them in this workflow to update Q&A profile.

Here is my code all works but the force Q&A profile.


function PostExecuting($workflow, $activity)
#Passcode length

#Passcode lifetime in minutes
$PASSCODE_LIFETIME = 1440 #(1 day)

#Parse request parameters - domain and user name
$domain = ""
$connection = $global.GetDirectoryConnectionByName($domain)
$userId = $Workflow.UserInfo.AccountInfo.objectGUID
$firstname = $Workflow.UserInfo.AccountInfo.givenname
$lastname = $

#Generate a passcode for a user
$PASSCODE= $global.GeneratePasscode($PASSCODE_LENGTH)

#Assign passcode to a user
$global.QAProfileAssignPasscode($connection, $userId, $passcode, $PASSCODE_LIFETIME)

#replace items in HTML file
$html = Get-Content "E:\Email\PasscodeEXT3.html"
$html = $html -replace "~passcode", $passcode
$html = $html -replace "~firstname", $firstname
$html = $html -replace "~lastname", $lastname

# generate email information
$subject = "Random Passcode generated"
$email = $Workflow.UserInfo.AccountInfo.mail

$global.EmailUserHtml($email, $subject, $html)


  • I found the following documentation on this method in the Password Manager source code:

    public bool ManuallyForcedToUpdateQAProfile { get; set; }

    Gets or sets a value indicating whether a user was forced to update the Q&A profile by a helpdesk operator. True if the user was forced to update Q&A profile by the helpdesk operator; otherwise, false.

    So it looks like this method doesn't do what you want it to do.

    I believe that you should be using the ForcedToUpdateQAProfile method. This method accepts a timestamp in DateTime format. Just set a time in the past, or grab today's date, and that should force the user to update their Q&A profile if they connect after that date.

Reply Children
No Data