<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Unable to Access PDI Due to Lost Passkey and Missing MFA Email Verification in Platform Privacy &amp; Security forum</title>
    <link>https://www.servicenow.com/community/platform-privacy-security-forum/unable-to-access-pdi-due-to-lost-passkey-and-missing-mfa-email/m-p/3546072#M256</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/683033"&gt;@jeffreybell&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you! Glad you found it useful &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Yes, restoring from source control or moving the work to a fresh PDI would definitely be the better approach in most cases.&lt;/P&gt;&lt;P&gt;In my case, I use my PDI a lot for quick development and testing, and over time I lost track of some changes that weren't captured in update sets or source control. Because of that, starting fresh wasn't very easy, so I wanted to find a way to recover the instance instead.&lt;BR /&gt;&lt;BR /&gt;It turned into an interesting recovery exercise, so I decided to share it with the community.&lt;/P&gt;</description>
    <pubDate>Wed, 20 May 2026 06:41:24 GMT</pubDate>
    <dc:creator>Rakesh_M</dc:creator>
    <dc:date>2026-05-20T06:41:24Z</dc:date>
    <item>
      <title>Unable to Access PDI Due to Lost Passkey and Missing MFA Email Verification</title>
      <link>https://www.servicenow.com/community/platform-privacy-security-forum/unable-to-access-pdi-due-to-lost-passkey-and-missing-mfa-email/m-p/3532301#M249</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hi Community,&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I recently faced an issue where I enabled &lt;STRONG&gt;MFA&lt;/STRONG&gt; on my &lt;STRONG&gt;PDI&lt;/STRONG&gt;, but I lost access to the passkey, and the email account is not properly configured to receive verification codes.However, I also tried disabling MFA via API, but this approach did not work in my case, so I need to explore an alternative way to regain access.&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5" color="#000000"&gt;&lt;STRONG&gt;Use Case:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;A user is unable to log in to their Personal Developer Instance because their Multi-Factor Authentication is tied to a passkey that was created on an old device, which is no longer available.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Although there is an alternative option to receive a verification code via email, the user is not receiving the MFA email.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;As a result, the user is completely locked out of the instance and is looking for a way to reset MFA or regain access without losing existing work.&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5" color="#000000"&gt;&lt;STRONG&gt;Approach:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Since I was locked out of the admin account due to MFA, I used another user who still has admin privileges to regain access.&lt;/FONT&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;First, I created a scheduled script (via API) that automatically generates a new password for that admin user and logs the temporary password in the system logs.&lt;/FONT&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Then, I used another script to fetch that password from the logs.&lt;/FONT&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;With the retrieved password, I logged in using that admin user.&lt;/FONT&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;After gaining access, I&amp;nbsp; removed the MFA configuration from the PDI.&lt;/FONT&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;In short, I used an alternate admin user, generated a temporary password programmatically, retrieved it from logs, and used it to log back in and fix the MFA issue.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Implementation:&lt;/FONT&gt;&lt;BR /&gt;A.Create Scheduled Job to Reset Password&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;You can find your instance credentials from the &lt;STRONG&gt;ServiceNow Developer Site&lt;/STRONG&gt;&amp;nbsp;under &lt;STRONG&gt;Manage My Instance&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;As shown in the image below, the highlighted section contains:&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;Instance URL&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;Username (usually admin)&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;Current password&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;This is the same information you need to use in the script.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PDI credentials.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/512262iEBA88CCB77AD6DEE/image-size/large?v=v2&amp;amp;px=999" alt="PDI credentials.png" title="PDI credentials.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;Open any Python environment&amp;nbsp; and execute the scripts using your own ServiceNow credentials.&lt;BR /&gt;&lt;FONT color="#000000"&gt;This script creates a scheduled job in ServiceNow that generates a new password for a user and logs it. Here, we are using &lt;STRONG&gt;david.loo&lt;/STRONG&gt; as the target user as he has the admin role.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests
from requests.auth import HTTPBasicAuth
import json

# ===== CONFIG ===== //Add your credentials here
instance = "https://&amp;lt;your-instance&amp;gt;.service-now.com"
username = "&amp;lt;admin_username&amp;gt;"
password = "&amp;lt;admin_password&amp;gt;"


auth = HTTPBasicAuth(username, password)

# ===== API URL =====
url = f"{instance}/api/now/table/sysauto_script"

# ===== PAYLOAD =====
payload = {
    "name": "Reset Password Job",
    "active": "true",
    "run_type": "once",
    "script": """
var username = 'david.loo';

var password = SNC.PasswordPolicyEvaluator.generateUserPassword(username);
gs.info("My Temporary Password: " + password);

var result = SNC.PasswordPolicyEvaluator.setUserPassword(username, password);
""",
   
    "next_action": "2026-04-27 18:30:00",
}

headers = {
    "Content-Type": "application/json",
    "Accept": "application/json"
}

# ===== REQUEST =====
response = requests.post(url, auth=auth, headers=headers, data=json.dumps(payload))

# ===== OUTPUT =====
print("Status Code:", response.status_code)&lt;/LI-CODE&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;Output:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-04-27 at 12.41.27 PM.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/512263iA3770A59B8068B92/image-dimensions/431x177?v=v2" alt="Screenshot 2026-04-27 at 12.41.27 PM.png" title="Screenshot 2026-04-27 at 12.41.27 PM.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;B.Retrieve Password from Logs:&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;This script is used to fetch the temporary password that was generated by the scheduled job and stored in the system logs.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests
from requests.auth import HTTPBasicAuth

instance = "https://&amp;lt;your-instance&amp;gt;.service-now.com"
username = "&amp;lt;admin_username&amp;gt;"
password = "&amp;lt;admin_password&amp;gt;"

auth = HTTPBasicAuth(username, password)

url = f"{instance}/api/now/table/syslog"

params = {
    "sysparm_query": "messageLIKEMy Tem^sys_created_onONToday@javascript&amp;amp;colon;gs.beginningOfToday()@javascript&amp;amp;colon;gs.endOfToday()",
    "sysparm_fields": "message",
    "sysparm_limit": "10"
}

headers = {
    "Accept": "application/json"
}

response = requests.get(url, auth=auth, headers=headers, params=params)

data = response.json()

for record in data.get("result", []):
    print(record["message"])&lt;/LI-CODE&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;Output:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-04-27 at 1.03.35 PM.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/512270i82CDBD95D93FE668/image-dimensions/437x168?v=v2" alt="Screenshot 2026-04-27 at 1.03.35 PM.png" title="Screenshot 2026-04-27 at 1.03.35 PM.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Open your instance URL in a private/incognito window.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;It will prompt you for login credentials.&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Username: &lt;STRONG&gt;david.loo&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;Password: Use the temporary password retrieved from the script output&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Then it will prompt you to change the password.&lt;/SPAN&gt;&lt;SPAN&gt;Update it with a new password of your choice, and log in again using the updated credentials.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Once logged in, you can access PDI and remove the MFA configuration.&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;STRONG&gt;Drawback:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;This approach only works if the last active session of the user was in the &lt;STRONG&gt;Global scope&lt;/STRONG&gt;. If the user was in a different application scope when they were last logged out, the scheduled script may not execute as expected.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2026 08:06:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/platform-privacy-security-forum/unable-to-access-pdi-due-to-lost-passkey-and-missing-mfa-email/m-p/3532301#M249</guid>
      <dc:creator>Rakesh_M</dc:creator>
      <dc:date>2026-04-27T08:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access PDI Due to Lost Passkey and Missing MFA Email Verification</title>
      <link>https://www.servicenow.com/community/platform-privacy-security-forum/unable-to-access-pdi-due-to-lost-passkey-and-missing-mfa-email/m-p/3545922#M255</link>
      <description>&lt;P&gt;It's very impressive&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could I ask though, if the PDI had important work on it and we&amp;nbsp; wouldn't want to lose that work, would having backed it up to source control and pulling that work back in to a fresh PDI been a viable solution here?&amp;nbsp; Or was this more of an exercise of 'look at this neat thing I had to do to recover my PDI'?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Either way, +1 from me, thank you for sharing your technique&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2026 21:28:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/platform-privacy-security-forum/unable-to-access-pdi-due-to-lost-passkey-and-missing-mfa-email/m-p/3545922#M255</guid>
      <dc:creator>jeffreybell</dc:creator>
      <dc:date>2026-05-19T21:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access PDI Due to Lost Passkey and Missing MFA Email Verification</title>
      <link>https://www.servicenow.com/community/platform-privacy-security-forum/unable-to-access-pdi-due-to-lost-passkey-and-missing-mfa-email/m-p/3546072#M256</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/683033"&gt;@jeffreybell&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you! Glad you found it useful &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Yes, restoring from source control or moving the work to a fresh PDI would definitely be the better approach in most cases.&lt;/P&gt;&lt;P&gt;In my case, I use my PDI a lot for quick development and testing, and over time I lost track of some changes that weren't captured in update sets or source control. Because of that, starting fresh wasn't very easy, so I wanted to find a way to recover the instance instead.&lt;BR /&gt;&lt;BR /&gt;It turned into an interesting recovery exercise, so I decided to share it with the community.&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2026 06:41:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/platform-privacy-security-forum/unable-to-access-pdi-due-to-lost-passkey-and-missing-mfa-email/m-p/3546072#M256</guid>
      <dc:creator>Rakesh_M</dc:creator>
      <dc:date>2026-05-20T06:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access PDI Due to Lost Passkey and Missing MFA Email Verification</title>
      <link>https://www.servicenow.com/community/platform-privacy-security-forum/unable-to-access-pdi-due-to-lost-passkey-and-missing-mfa-email/m-p/3590034#M338</link>
      <description>&lt;P&gt;If you still have access to PDI using alternate admin account, another alternate approach is to reset the MFA for the user in focus who has lost the passkey/MFA key (if you still know the password for that user of course).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How as an admin, you can reset the MFA for any other user -&lt;/P&gt;
&lt;P&gt;Navigate to below mentioned tables list view and clear the records from each of these tables against the user for whom the MFA passkey or MFA factor is lost.&lt;/P&gt;
&lt;P&gt;- user_multifactor_auth (for TOTP)&lt;/P&gt;
&lt;P&gt;- sys_user_public_credential (for FIDO Passkey, Mobile Passkey, Security Key or Apple TouchID etc, it may have multiple records if more than one FIDO factor is registered).&lt;/P&gt;
&lt;P&gt;- sys_user_multi_factor_setup (Stores all the factors including Email, SMS, TOTP and FIDO setup against a user, may have multiple records).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you are done deleting the records from these tables, you should be able to login with the username and password and will be asked to setup MFA again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2026 19:00:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/platform-privacy-security-forum/unable-to-access-pdi-due-to-lost-passkey-and-missing-mfa-email/m-p/3590034#M338</guid>
      <dc:creator>Ambuj Tripathi</dc:creator>
      <dc:date>2026-08-21T19:00:56Z</dc:date>
    </item>
  </channel>
</rss>

