It depends on the situation. This is an area where I would tread carefully.
You need to really have a good understanding of the people on your team and if using profanity will create an unsafe environment or not. Have I ever used profanity at work, yes. Do I use it often, No.
One area that I would say there are not any exceptions at all is using profanity when talking to a specific person. I would never use profanity in talking directly to an employee especially in anger or frustration. You will lose all respect.
When in doubt, nobody is going to ever fault you or complain for NOT using profanity. So not using profanity is always the safest option.