The Pentagon has launched a sweeping review into misconduct by senior officers, Defense Secretary Leon E. Panetta announced Thursday, a rare undertaking at the nation’s largest bureaucracy, beset by recent high-profile scandals involving the brass.

Defense officials said the probe was conceived before two of the nation’s most-respected generals were ensnared in a bizarre FBI investigation that exposed the extramarital affair of former CIA chief David H. Petraeus, a retired four-star Army general, and triggered an investigation into the propriety of e-mail exchanges between a Tampa socialite and Marine Gen. John R. Allen, the top commander of U.S. and NATO troops in Afghanistan.

Other recent cases have ranged from allegations of administrative improprieties to a lurid rape case that prompted the Pentagon to yank a brigadier general from a key post in southern Afghanistan this spring.

The Defense Department’s inspector general says the number of substantiated allegations of wrongdoing by senior officers has risen steadily in recent years, prompting the office to hire several new investigators.

The scandals have stunned the military establishment and shocked a public accustomed, after 11 years of war, to venerating those who serve. Panetta was frank in acknowledging that the malfeasance of top brass could be demoralizing for troops and civilians.

“As has happened recently, when lapses occur, they have the potential to erode public confidence in our leadership,” Panetta wrote in a directive to Gen. Martin E. Dempsey, the chairman of the Joint Chiefs of Staff, who has been asked to deliver a preliminary report by the end of the month. “Worse, they can be detrimental to the execution of our mission to defend the American people.”

The effort could shed light on whether the multiple deployments in a decade of war, which have exacted a well-documented toll on an all-volunteer force, also are afflicting those in command.

Some military officers suggest that the problem is systemic, part of a long-established double standard of punishment.

“There’s a set of rules for generals and a set of rules for everyone else when it comes to punishment,” said an Army officer who spoke on the condition of anonymity to speak critically about the initiative. “No one in their right mind believes you have to remind general officers to obey the law or not have adulterous affairs.”

Testimony in the rape case of Brig. Gen. Jeffrey Sinclair, the former deputy commander of the 82nd Airborne Division, echoed that view. According to a witness who testified this month at a hearing that will determine whether the general is court-martialed, Sinclair was dismissive when challenged about making a demeaning remark about women.

“I’m a general,” Sinclair said, the witness testified. “I’ll do whatever the [expletive] I want.”

The review, which Panetta announced after arriving in Thailand on the second stop of an Asia trip, comes amid questions over whether the Pentagon under his stewardship is doing enough to hold leaders accountable. Panetta has said little in public about the recent cases and hasn’t fired any commanders since taking charge in July 2011. In contrast, his predecessor, Robert M. Gates, was quick to sack generals and admirals for what he deemed poor performance or a lack of accountability.

Panetta “hasn’t had to fire anyone at the military rank [that] Gates did because no one at those ranks has done something to warrant it on his watch,” said a senior defense official, speaking on the condition of anonymity to discuss the Pentagon chief’s leadership style.

On Tuesday, Panetta demoted Gen. William E. “Kip” Ward, the former four-star commander of the military’s Africa Command, and the Army ordered him to repay $82,000 for billing the Pentagon for unjustified expenses, including lavish trips with his wife.

Another inspector-general investigation this fall critiqued the three-star commander of the Missile Defense Agency for creating a work environment that one aide described as “management by blowtorch and pliers.” He remains at the helm of the agency.

The inspector general faulted Adm. James G. Stavridis, the supreme allied commander of NATO, for administrative lapses involving travel and other expenses. The Navy cleared him of misconduct.

Marguerite C. Garrison, a deputy inspector general for the Defense Department, said in a recent interview that the number of probes into alleged misconduct by senior officials this year is on track to surpass last year’s. In 2011, the office reviewed 38 cases and substantiated nearly 40 percent. That represented a 21 percent increase from the number of substantiated claims in 2007.

Lt. Gen. James M. Dubik, who retired in 2008 after overseeing training for Iraq’s security forces, said the vast majority of senior officers conduct themselves properly. But he added that officers in senior roles may be tempted to bend or break the rules.

“Generals are surrounded by people who want to serve them,” Dubik said. “Any senior job comes with the risk of abusing your position. Sometimes those abuses take the form of monetary abuse, sometimes they are sexual abuse of subordinates and sometimes it’s more a matter of forgetfulness.”

Panetta said he expects “senior officers and civilian executives to exercise sound judgment in their stewardship of government resources and in their personal conduct.” He added: “An action may be legally permissible but neither advisable nor wise.”

Also Thursday, Panetta said he had no evidence that any other military chief would be entangled in the scandal sparked by the FBI probe that uncovered questionable behavior by Petraeus and Allen.

“I’m sure we’ll have to await and see what additional factors are brought to our attention,” Panetta said during a news conference.

Panetta directed the Defense Department’s inspector general to investigate “potentially inappropriate” behavior by Allen after learning that the general and a Tampa socialite had sent each other thousands of e-mails over a three-year period.

Allen, who is married, has denied any wrongdoing. Allen’s associates have said that he did not have an affair with the woman, 37-year-old Jill Kelley, a surgeon’s wife who frequently entertained high-ranking military officials from MacDill Air Force Base in Tampa at her bayfront home.

Londoño reported from Washington.