<?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>topic REST API Add Safe member- user from a directory mapping in PAM Self-Hosted Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/rest-api-add-safe-member-user-from-a-directory-mapping/m-p/1318132#M17862</link>
    <description>&lt;P&gt;Hi, is it possible to add users from a directory mapping which are domain users using the Add Safe member API reference?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are looking to automate the onboarding of a personal domain level privileged account into a safe created for an individual and align the persons domain unprivileged account as a safe member all up front before user login using the API? &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have ~700 users to create safes and accounts for and looking to utilise the API to limit the amount of manual onboarding we need to do for these persona priv accounts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So user x12345 in domain, safe x12345 where we we want add the safe member x12345 from the domain to there personal safe created in the 1st part of the script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have another script adding y12345 privileged account to the safe created in 1st script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have the script working with CyberArk users just now wanted to add in a reference to a domain account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a requirement to have personal named safes for admins where the personal privileged accounts are stored,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its is our intention to use RSA/Radius as our auth method of choice and looking to ultimately automate onboarding fully.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code snippet we have currently is as follows:&lt;/P&gt;&lt;P&gt;# This section will add the first required owner from the csv now that the safes have been created - Should be Administrator2&lt;/P&gt;&lt;P&gt;Import-CSV CreateSafes.csv | Foreach-Object{&lt;/P&gt;&lt;P&gt; $safename = $_.safename&lt;/P&gt;&lt;P&gt; $owner1 = $_.owner1&lt;/P&gt;&lt;P&gt; $member1Data = @{&lt;/P&gt;&lt;P&gt; memberName = "$owner1"&lt;/P&gt;&lt;P&gt; searchIn = "Vault"&lt;/P&gt;&lt;P&gt; membershipExpirationDate = ""&lt;/P&gt;&lt;P&gt; permissions = @{&lt;/P&gt;&lt;P&gt; listAccounts = "true";&lt;/P&gt;&lt;P&gt; retrieveAccounts = "true";&lt;/P&gt;&lt;P&gt; addAccounts = "true";&lt;/P&gt;&lt;P&gt; updateAccountContent = "true";&lt;/P&gt;&lt;P&gt; updateAccountProperties = "true";&lt;/P&gt;&lt;P&gt; renameAccounts = "true";&lt;/P&gt;&lt;P&gt; deleteAccounts = "true";&lt;/P&gt;&lt;P&gt; viewAuditLog = "true";&lt;/P&gt;&lt;P&gt; viewSafeMembers = "true";&lt;/P&gt;&lt;P&gt; useAccounts = "true";&lt;/P&gt;&lt;P&gt; initiateCPMAccountManagementOperations = "true";&lt;/P&gt;&lt;P&gt; specifyNextAccountContent = "true";&lt;/P&gt;&lt;P&gt; createFolders = "true";&lt;/P&gt;&lt;P&gt; deleteFolders = "true";&lt;/P&gt;&lt;P&gt; unlockAccounts = "true";&lt;/P&gt;&lt;P&gt; moveAccountsAndFolders = "true";&lt;/P&gt;&lt;P&gt; manageSafe = "true";&lt;/P&gt;&lt;P&gt; manageSafeMembers = "true";&lt;/P&gt;&lt;P&gt; backupSafe = "true";&lt;/P&gt;&lt;P&gt; accessWithoutConfirmation = "true";&lt;/P&gt;&lt;P&gt; requestsAuthorizationLevel1 = "true"&lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt; MemberType = "User"}&lt;/P&gt;&lt;P&gt; $member1json = $member1Data | ConvertTo-Json -Depth 99&lt;/P&gt;&lt;P&gt; $members1url = "&lt;A alt="https://pvwaaddress/PasswordVault/API/Safes/$safename/Members/%22" href="https://pvwaaddress/PasswordVault/API/Safes/$safename/Members/%22" target="_blank"&gt;https://pvwaaddress/PasswordVault/API/Safes/$safename/Members/"&lt;/A&gt;&lt;/P&gt;&lt;P&gt; $members1 = Invoke-RestMethod -ContentType "application/json" -Uri $members1url -Method Post -H @{"Authorization" = "$token"} -B $member1json}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What edits would we need to make to the above snippet to reference a domain user from a user mapping?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Documentation suggests refers to the "searchin" parameter?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have tried to reference a known user mapping and getting the error below:&lt;/P&gt;&lt;P&gt;PS C:\scripts&amp;gt; C:\scripts\CreateSafesstc.ps1&lt;/P&gt;&lt;P&gt; Username: Admin1&lt;/P&gt;&lt;P&gt; Invoke-RestMethod : {"ErrorCode":"SFWS0014","ErrorMessage":"Failed to find user u8****** in ldap mapping Users__****."}&lt;/P&gt;&lt;P&gt; At C:\scripts\CreateSafesstc.ps1:68 char:13&lt;/P&gt;&lt;P&gt; + $members1 = Invoke-RestMethod -ContentType "application/json" -Uri $m ...&lt;/P&gt;&lt;P&gt; +&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;+ CategoryInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;: InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand&lt;/P&gt;&lt;P&gt; Logging Off&lt;/P&gt;&lt;P&gt; Script Finished&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are also unsure where the extra . is appearing at the end of the user mapping name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seemed doable on paper but maybe a step to far for full automation of creating a safe, assigning an external user(who hasn't logged on yet) and adding an account. With the "user who hasnt logged in yet" and the vault having no hook for the external user yet to assign as a safe member being the current stumbling block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any responses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2026 13:43:27 GMT</pubDate>
    <dc:creator>sclarlvN</dc:creator>
    <dc:date>2026-03-02T13:43:27Z</dc:date>
    <item>
      <title>REST API Add Safe member- user from a directory mapping</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/rest-api-add-safe-member-user-from-a-directory-mapping/m-p/1318132#M17862</link>
      <description>&lt;P&gt;Hi, is it possible to add users from a directory mapping which are domain users using the Add Safe member API reference?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are looking to automate the onboarding of a personal domain level privileged account into a safe created for an individual and align the persons domain unprivileged account as a safe member all up front before user login using the API? &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have ~700 users to create safes and accounts for and looking to utilise the API to limit the amount of manual onboarding we need to do for these persona priv accounts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So user x12345 in domain, safe x12345 where we we want add the safe member x12345 from the domain to there personal safe created in the 1st part of the script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have another script adding y12345 privileged account to the safe created in 1st script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have the script working with CyberArk users just now wanted to add in a reference to a domain account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a requirement to have personal named safes for admins where the personal privileged accounts are stored,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its is our intention to use RSA/Radius as our auth method of choice and looking to ultimately automate onboarding fully.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code snippet we have currently is as follows:&lt;/P&gt;&lt;P&gt;# This section will add the first required owner from the csv now that the safes have been created - Should be Administrator2&lt;/P&gt;&lt;P&gt;Import-CSV CreateSafes.csv | Foreach-Object{&lt;/P&gt;&lt;P&gt; $safename = $_.safename&lt;/P&gt;&lt;P&gt; $owner1 = $_.owner1&lt;/P&gt;&lt;P&gt; $member1Data = @{&lt;/P&gt;&lt;P&gt; memberName = "$owner1"&lt;/P&gt;&lt;P&gt; searchIn = "Vault"&lt;/P&gt;&lt;P&gt; membershipExpirationDate = ""&lt;/P&gt;&lt;P&gt; permissions = @{&lt;/P&gt;&lt;P&gt; listAccounts = "true";&lt;/P&gt;&lt;P&gt; retrieveAccounts = "true";&lt;/P&gt;&lt;P&gt; addAccounts = "true";&lt;/P&gt;&lt;P&gt; updateAccountContent = "true";&lt;/P&gt;&lt;P&gt; updateAccountProperties = "true";&lt;/P&gt;&lt;P&gt; renameAccounts = "true";&lt;/P&gt;&lt;P&gt; deleteAccounts = "true";&lt;/P&gt;&lt;P&gt; viewAuditLog = "true";&lt;/P&gt;&lt;P&gt; viewSafeMembers = "true";&lt;/P&gt;&lt;P&gt; useAccounts = "true";&lt;/P&gt;&lt;P&gt; initiateCPMAccountManagementOperations = "true";&lt;/P&gt;&lt;P&gt; specifyNextAccountContent = "true";&lt;/P&gt;&lt;P&gt; createFolders = "true";&lt;/P&gt;&lt;P&gt; deleteFolders = "true";&lt;/P&gt;&lt;P&gt; unlockAccounts = "true";&lt;/P&gt;&lt;P&gt; moveAccountsAndFolders = "true";&lt;/P&gt;&lt;P&gt; manageSafe = "true";&lt;/P&gt;&lt;P&gt; manageSafeMembers = "true";&lt;/P&gt;&lt;P&gt; backupSafe = "true";&lt;/P&gt;&lt;P&gt; accessWithoutConfirmation = "true";&lt;/P&gt;&lt;P&gt; requestsAuthorizationLevel1 = "true"&lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt; MemberType = "User"}&lt;/P&gt;&lt;P&gt; $member1json = $member1Data | ConvertTo-Json -Depth 99&lt;/P&gt;&lt;P&gt; $members1url = "&lt;A alt="https://pvwaaddress/PasswordVault/API/Safes/$safename/Members/%22" href="https://pvwaaddress/PasswordVault/API/Safes/$safename/Members/%22" target="_blank"&gt;https://pvwaaddress/PasswordVault/API/Safes/$safename/Members/"&lt;/A&gt;&lt;/P&gt;&lt;P&gt; $members1 = Invoke-RestMethod -ContentType "application/json" -Uri $members1url -Method Post -H @{"Authorization" = "$token"} -B $member1json}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What edits would we need to make to the above snippet to reference a domain user from a user mapping?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Documentation suggests refers to the "searchin" parameter?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have tried to reference a known user mapping and getting the error below:&lt;/P&gt;&lt;P&gt;PS C:\scripts&amp;gt; C:\scripts\CreateSafesstc.ps1&lt;/P&gt;&lt;P&gt; Username: Admin1&lt;/P&gt;&lt;P&gt; Invoke-RestMethod : {"ErrorCode":"SFWS0014","ErrorMessage":"Failed to find user u8****** in ldap mapping Users__****."}&lt;/P&gt;&lt;P&gt; At C:\scripts\CreateSafesstc.ps1:68 char:13&lt;/P&gt;&lt;P&gt; + $members1 = Invoke-RestMethod -ContentType "application/json" -Uri $m ...&lt;/P&gt;&lt;P&gt; +&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;+ CategoryInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;: InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand&lt;/P&gt;&lt;P&gt; Logging Off&lt;/P&gt;&lt;P&gt; Script Finished&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are also unsure where the extra . is appearing at the end of the user mapping name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seemed doable on paper but maybe a step to far for full automation of creating a safe, assigning an external user(who hasn't logged on yet) and adding an account. With the "user who hasnt logged in yet" and the vault having no hook for the external user yet to assign as a safe member being the current stumbling block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any responses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2026 13:43:27 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/rest-api-add-safe-member-user-from-a-directory-mapping/m-p/1318132#M17862</guid>
      <dc:creator>sclarlvN</dc:creator>
      <dc:date>2026-03-02T13:43:27Z</dc:date>
    </item>
  </channel>
</rss>

