Deputy Defense Secretary Patrick Shanahan has issued a strict warning to Department of Defense employees — both civilian and military — to use only official government email to conduct official business except in “rare and extraordinary” circumstances.

In a Tuesday memo obtained by the Washington Examiner, Shanahan warns Pentagon workers that using “non-official electronic messaging accounts, including personal email accounts” to conduct official DoD communications is both against the law and DoD policy.

“I expect leaders at every level within the Department to set a personal example and to ensure that those they lead uphold these responsibilities,” Shanahan said in the memo. “We must be vigilant to protect DoD information and ensure the transparency that the law requires.”

In December 2015, the New York Times revealed that then-Defense Secretary Ash Carter used his personal email account to conduct some of his professional correspondence during his first two months on the job.

That was particularly embarrassing as while Hillary Clinton was under scrutiny for using a personal email account as secretary of state.

Carter apologized for the mistake, admitting he occasionally used his iPhone to send messages to immediate staff, but insisted the brief communications did not include classified information.

“I expect all DoD personnel to use their official DoD email or other official DoD electronic messaging accounts when conducting DoD business,” Shanahan wrote, noting that appointment to federal office in the DoD “entails enormous responsibility for safeguarding our people, data, and public trust.”

The memo notes that there should be very few exceptions to the policy and that intentional violations may be the basis for disciplinary action.

“Personal or other non-official email accounts may be used for official business only in those rare and extraordinary situations where an official email capability is not available,” the memo states. An example, the memo said, could be when a DoD official is out of the office without access to official communication channels and must send an urgent DoD mission-related email.

“When this happens, the DoD official shall copy his official email account at the time of sending or forward the message to his official account within 20 days of sending the email.”

But the guidance states that under no circumstances should any classified information ever be transmitted over any unclassified networks.