+ Start a Discussion
Ben HorleyBen Horley 

Using Ant to add IP addresses to a profile

Hello all

We have a requirement to add 70 or so IP addresses to a profile whitelist.

I was able to retrieve the profile using Ant retrieve and, looking at the metadata, you can see the IP's specified in the whitelist. I want to add IP's while keeping the existing ones intact instead of having to get the existing ones, merge them with the new ones then upload the lot.

I was not able to find this documented anywhere but it seemed logical that you could update a profile without having to upload the entire profile so I tried the following.


<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">


<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
        <description>Azure IP</description>

This sucessfully added that IP to the profile whitelist but wiped out what was already there. Do you know how I can append to the list instead of replacing it?

Cheers, Ben 
Guillaume LoubierGuillaume Loubier
It's a little late, but to not wipe out what's already there, you'll need to 
1. Retrieve that package.xml from the destination org
2. Retrieve the same from the source org
3. Use a diff tool (I'm using DiffMerge from Sourcegear, but any diff tool would work
4. Compare the 2 package folders and merge all profiles to get the old and new login ip ranges
5. Deploy your merged package.

Note: I'm doing that for every dpeloyments. That way, you can merge whatever changes from other team to the package so that you don't remove new stuff that you may not have yet in the source org