The aforementioned solution would not be appropriate, though, if we wanted to turn CDP off for a range of ports.
To turn off CDP for a range of ports, we would need to create a leaf interface profile. To do this, we navigate to Interface Policies | Profiles | Leaf Profiles, right-click on it, and select Create Leaf Interface Profile.
Name the profile and click on the plus sign next to Interface Selectors.
Enter a name for the port selector, and enter the ports in the Interface IDs row. Select CDP-Off as the Interface Policy ...