In every case of excommunication, the one on trial is not regarded by the church as losing their priesthood. They are instead requested to temporarily stop using it. Inside the church itself, they are not permitted to use it. But it is up to the individual to decide whether or not to use it in other circumstances. Before annotations were made to church membership records, the way excommunication was apparent was by comparing the date of baptism to the date of ordination. If a member had been ordained before their baptism, then it was apparent they had been excommunicated.
O.K. As the famous jock sniffer Chris Berman would say, let's go to the record book. And in this case, the record book is a September 1990 article entitled "A Chance to Start Over: Church Disciplinary Councils and the Restoration of Blessings", authored by Elder M. Russell Ballard, a member of the Quorum of the Twelve. You can't get much more authoritative than the Quorum of the Twelve. Elder Ballard had visited a man in hospital who had been excommunicated, but who had fully repented and was re-baptized. But the man sought restoration of his Priesthood blessings. Here's the pertinent part of Elder Ballard's account:
Some time ago I was asked by the First Presidency to stop and visit a man on my way to a stake conference. This man had been excommunicated, had fully repented, and had been found worthy to be baptized. But baptism did not restore his priesthood and temple blessings. That was my assignment, acting on behalf of the Lord at the direction of the President of the Church.
I placed my hands on his head and, using terminology associated with this ordinance, restored to him the Melchizedek Priesthood.
He sobbed -- perhaps the first sounds he had made in some time. I restored his office in the priesthood. Then I restored to him, by the power of the priesthood, the holy endowment that he had received when he went through the temple for the first time. Last, I restored what was perhaps most valuable to him -- his sealings to his wife and children.
Wait a minute! If excommunication doesn't remove Priesthood, then why did Elder Ballard specifically have to restore the man's Priesthood to him? This would strongly imply that Priesthood is removed upon excommunication. Reading Elder Ballard's article further, we find this to be the case:
The third decision the council may take is to disfellowship the member. Disfellowshipment is usually temporary, though not necessarily brief. Disfellowshipped persons retain membership in the Church. They are encouraged to attend public Church meetings, but are not entitled to offer public prayers or to give talks. They may not hold a Church position, take the sacrament, vote in the sustaining of Church officers, hold a temple recommend, or exercise the priesthood. They may, however, pay tithes and offerings and continue to wear temple garments if endowed.
Excommunication is the most severe judgment a Church disciplinary council can take. Excommunicated persons are no longer members of the Church. Therefore, they are denied the privileges of Church membership, including the wearing of temple garments and the payment of tithes and offerings. They may attend public Church meetings, but, like disfellowshipped persons, their participation in such meetings is limited. Excommunicated persons are encouraged to repent and so live as to qualify for eventual baptism.
Tim Malone attempts to address the dichotomy here. He distinguishes between Priesthood power and Priesthood authority. Citing President Boyd K. Packer’s April 2010 General Conference talk on the subject of the Power of the Priesthood, he asserts the Priesthood power and Priesthood authority are not necessarily one and the same, noting that Priesthood authority has tended to outrace Priesthood power. This makes sense, since when one has Priesthood authority conferred upon them and is ordained to a specific office, one can then officially exercise Priesthood power thereafter.
Nevertheless, it is clear from Elder Ballard's counsel that when one is excommunicated from the LDS Church, one loses his Priesthood authority. Whether an excommunicant can exercise Priesthood power on his own behalf will depend upon his own behavior subsequent to excommunication. In Matthew 7:21-23, the Savior makes it clear that Priesthood authority is necessary in order for Priesthood power to have any efficacy or force, writing "Many will say to me in that day, Lord, Lord, have we not prophesied in thy name and in thy name have cast out devils and in thy name done many wonderful works? And then will I profess unto them, I never knew you: depart from me, ye that work iniquity".
The phrase "I never knew you" would seem to imply that they never had His legal authority to act in His name.
Do NOT confuse Priesthood power with Priesthood authority. Righteous pastors and priests from other faiths who perform miracles may be using Priesthood power, but they do not have Priesthood authority, and though the Lord may choose to recognize and act upon their works, He is not bound to do so. Elder Robert D. Hales of the Quorum of the Twelve also drives home the need for legal Priesthood authority in a February 2002 Ensign article entitled "Gifts Of The Spirit", in which he writes "one cannot invoke the blessings of heaven without having received the gifts and the right or authority to act in His name". Priesthood authority requires a covenant with the Lord, and when you covenant with the Lord and do as He says, He is bound to live up to His end of the deal.