function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sajid PeerjadeSajid Peerjade 

Unable to retrieve password policies for all Profiles

Can we retrieve password policies for all Profiles through VS Code or Eclipse? If yes how.
SwethaSwetha (Salesforce Developers) 
HI Sajid,
According to the article given below,We can retrieve password policies using Metadata API from version 40 and latest
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_profilepasswordpolicy.htm

Try the package.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ProfilePasswordPolicy</name>
</types>
<version>47.0</version>
</Package>

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Sajid PeerjadeSajid Peerjade
Hello Swetha,

I am able to retrieve password policies in VS Code for all profiles for one Salesforce org but not able to retrieve from another org. Both are PROD and same access. What could be reason? Can you help?


Thanks and regards,
Sajid
SwethaSwetha (Salesforce Developers) 
Do you see any error message in the org where it isn't working?
SwethaSwetha (Salesforce Developers) 
HI Sajid, Just following up to see if you have any inputs on my ask..
Sajid PeerjadeSajid Peerjade
Hello Swetha,
No, there is no error message. I am able to get only 3 profile's password policies from that Org and from second org I was able to retrieve all password policies of profiles.