By Mary Jo Foley, special to Fortune  FORTUNE -- On the eve of his exit as chief executive officer of Microsoft, after more then a decade on the job, it is more evident than ever that Steve Ballmer's image does not always reflect reality.  As anyone who has ever seen him speak at a conference (or portrayed on television, as he was in cartoon form on the animated series South Park this year) knows, Ballmer is a larger-than-life kind of guy. His public persona is brash, bombastic and, at times, bordering on boorish. To most people, he is known more for his manner than his management.  But look closely, and you'll notice that the real Steve Ballmer is responsible for making a handful of largely unsung strategic decisions during his tenure as CEO of Microsoft (MSFT) that will continue to affect the company and industry long after a new leader takes the helm of the Redmond, Wash.-based company.  For example, it was Ballmer who made it a priority to settle the hundreds of antitrust, class-action and other lawsuits facing the company when he was appointed chief executive in January 2000. It was Ballmer who championed Microsoft's foray into the living room, starting in 2001 with the Xbox gaming console. Ballmer was key to Microsoft evolving into an enterprise powerhouse, grasping early the financial and strategic importance of courting IT professionals. Ballmer also brought a new level of business rigor to the company, which led to it shedding a number of products and business units that couldn't demonstrate their "monetizability."  To be fair, Ballmer has admitted publicly and repeatedly that he goofed badly with managing and overseeing Longhorn, the delayed engineering project which ultimately debuted as the ill-received Windows Vista operating system. But in a recent interview with Fortune, he adamantly insisted he got more right than wrong during the 13 years he ran Microsoft.  Starting with money: under Ballmer, Microsoft's profits doubled, revenues tripled. "In the last five years, probably Apple has made more money than we have," Ballmer says during a sit-down in his office in Redmond, in what's expected to be his final press interview as CEO. "But in the last 13 years, I bet we've made more money than almost anybody on the planet. And that, frankly, is a great source of pride to me."  There have been missteps along the way to those profits. Like Microsoft's $6 billion acquisition in 2007 of the online ad firm aQuantive, on which the company took a $6.2 billion write-down five years later after failing to capitalize on its products and services. Or the purchase of mobile services company Danger in 2008, which spawned the short-lived Microsoft Kin family of mobile phones.  There were some close calls, too, such as Microsoft's scrapped purchase of Yahoo for $45 billion in 2008. But there have been several decisions that did pan out. One of those was FAST Search & Transfer, which Microsoft bought in 2008 for $1.2 billion and integrated into the enterprise search technology at the heart of Microsoft's very profitable SharePoint family. Another was Navision a/s, which the company bought in 2002 for $1.5 billion and ultimately turned into the heart of its now thriving Dynamics ERP business.  "Have we made mostly good acquisitions? " Ballmer asks, rhetorically. "The answer is yes. We really have made mostly good acquisitions. We spent a billion dollars on FAST; we make good money. Dynamics, we did two acquisitions, each just over a billion—believe you me, they look really good. Some of them take a little longer to kick in. The aQuantive acquisition? Obviously not a good acquisition. But in the company we were, it's about acquiring in addition to managing costs and getting price. And we have been very good at that."  When Microsoft co-founder and then-chief executive Bill Gates hired Ballmer from Procter & Gamble in 1980, it was to be "the business guy, whatever that meant," Ballmer says. Since that day, his rallying cry has always been "How do you make money? How do you make money? How do you make money?" (Imagine him chanting this in the same way he hollered "Developers, developers, developers!" at a now-famous company summit in 2000. Now picture him doing so, calmly, as he kicks back in an upholstered chair in his office in Building 34 on the company's Redmond campus.)  "That doesn't mean nobody else ever thought about it, but 'How do you make money?' was what I got hired to do," Ballmer says. "I've always thought that way."  As CEO, Ballmer brought a new level of business rigor to Microsoft. Instead of allowing hundreds of products to bloom because they sounded potentially interesting or trendy, Ballmer required of business justification, often in excruciating detail. Only then would he give new businesses his stamp of approval.  "I would say that it has been a hallmark of mine since arrival," Ballmer says. "I've always had the unique, valuable perspective of being on the front line selling, working with our partners, because in some senses your ability to understand how to make money is heavily shaped by what you think people will pay for, in addition to what it costs to get things done."  In 2005, he hired Kevin Turner from Wal-Mart Stores, where he was Executive Vice President, to become Microsoft's Chief Operating Officer. Turner upped the rigor even further with tools like "scorecards" for measuring customer satisfaction and other key sales metrics.  "Ballmer's famous statement is, 'If you deal with me, you deal in detail,'" says Satya Nadella, Executive Vice President of Microsoft's Cloud and Server business. "If you don't have the details, don't give him the stuff."  Ballmer's notoriously outgoing personality also helped Microsoft strike deals. His early career experience in sales translated well during corporate negotiations, particularly in assisting the company to settle the numerous lawsuits that faced the company early in his tenure.  When Ballmer took over as CEO, Microsoft was in the midst of fighting a bitter antitrust complaint brought against the company in 1998 by the U.S. government and 20 states. For several years, Gates' attitude suggested that he would rather fight the claims than settle; upon replacing Gates, Ballmer made it a top priority for the company to put the cases behind it as quickly as possible.  It was less about the cost and more about public perception, he says.  "Being the object of a lawsuit, effectively, or a complaint from your government is a very awkward, uncomfortable position to be in," Ballmer says. "It just has all downside. People assume if the government brought a complaint that there's really a problem, and your ability to say we're a good, proper, moral place is tough. It's actually tough, even though you feel that way about yourselves."  Multiply that several times over and you get a sense of what Ballmer inherited. Brad Smith, Microsoft's General Counsel, recalls that the company was facing antitrust investigations in 20 other countries, plus 206 additional class-action lawsuits against Microsoft in 40 states and the District of Columbia. Add to that another set of complaints pending from 12 competitors, including Sun Microsystems, AOL and IBM, and it's clear that the company had a major distraction on its hands, he said.  "I would just say it was probably the biggest sort of legal overhang that any major company really had to address between say probably 1990 and 2010, in that twenty-year period," Smith says.  Settling the cases ended up costing Microsoft between $5 billion and $6 billion, Smith says. (By 2005, most of the settlements were finalized.) Ballmer's pragmatism, his relationship-building skills and his sense of calm—yes, you read that correctly—were all key to getting it done, Smith says.  "Steve has great interpersonal skills," Smith says. "I think he's always had this ability to connect with other people, to listen to other people, and I think those skills were well-honed in the years that he led the sales force for Microsoft. And so he was able to bring a unique set of skills that were put to the test as CEO in his first year of doing this."  Ballmer also played a significant role in building Microsoft to become one of the largest technology providers to big businesses. Today, Microsoft maintains a $20 billion enterprise business. This wasn't always the case; Microsoft began as a consumer-hobbyist company.  "People think of Microsoft as having inherited its enterprise software company chops by virtue of Windows and Office," says Andrew Brust, founder of Blue Badge Insights, a Microsoft-focused analyst firm in New York City. "That's revisionist, though. The truth is that Exchange, Windows Server, SQL Server, SharePoint, System Center and Dynamics CRM each faced an uphill battle. Microsoft persevered, and now each of these products is either a major player in its category or dominates it altogether. That's the genesis of Microsoft's enterprise juggernaut, and it was built slowly and steadily on Ballmer's watch."  Ballmer says that it took many years to shift public perception of the company. "It's really only the last five or six years that people say we're right for the enterprise," he says. "Now people say we're like, 'born for the enterprise.' But I would say as recently as about 2007 or 2008, we'd still have people who would say we weren't an enterprise supplier at all."  That's particularly surprising since, in 1988 under Gates, Microsoft hired Dave Cutler, the celebrated father of the VMS minicomputer operating system, to help write a brand-new operating system for businesses: Windows NT.  Ballmer cites this period, when the company gradually added networking and database field expertise to its repertoire, as important in informing his later management of Microsoft's enterprise businesses. It's when he gained first-hand exposure to customers' requirements and expectations around pricing and licensing, he says. It's when he forged relationships with reseller partners who knew how to sell to the enterprise. And it's why, as CEO, he made it a priority to invest more in support and services.  "We just kept hell-bent and determined—in a good way, in a positive way—to prove that we could be enterprise-worthy," Ballmer says. And "that's one [area] that I feel particular unique sponsorship for. I feel particularly good about having pushed that."  Ballmer wasn't all business-focused, however. One of his first major decisions as CEO was whether or not Microsoft should enter the gaming market with the Xbox. Gates was all-in, but Ballmer says he considered his approval of the device to be a turning point for him to establish himself as the new chief executive.  Getting into the living room with the Xbox? That "was my decision, my accountability," Ballmer says. "I believe in accountability. I'm in. I'm accountable. I'll make this work—not that I had to drive it—but we had some bumps on the road. And it was important that I stay accountable, stay patient, and stay behind the decision that we made."  Robbie Bach, the former head of Microsoft's Entertainment and Devices division and head of Xbox from the launch of the original Xbox in 2001, remembers Ballmer spending six months conducting a thorough business review to determine whether there was actually opportunity for Microsoft before giving the team the go-ahead. He made the call one month into his new role.  "He was willing to step out into a space that Microsoft had never been in, look at a business model, and say this is something we need to try," Bach says.  Since 2000, Microsoft has spent billions to expand in a market that has evolved to encompass the entire living room. What began as a device that used a non-Windows operating system written almost entirely from scratch has become a dominant console and entry point in the growing connected television ecosystem. Even when the console hit speed bumps—competing on price against Sony, Microsoft took a loss on the first generation; faced with "red ring of death" console glitches, Microsoft took a billion-dollar write-off in 2008 against the second generation—Ballmer backed the team every step of the way, Bach says.  "It is easy to bemoan billions spent on Xbox," says Charles Fitzgerald, a former Microsoft strategist and current tech investor, "but when you look at it as a hedge to keep Sony or any game console from undermining the Windows PC, it is chump change compared to the hundreds of billions in Windows profits banked during that time."  As Ballmer prepares for his exit, he leaves many questions unanswered. Did he protect Microsoft's crown jewels, Windows and Office, for too long at the expense of pursuing new businesses enabled by technologies such as cloud computing and mobile devices? Has he been too slow in overseeing Microsoft's transition from being the Samson of software to the devices and services company he claims he wants it to be?  "I think we will look back and conclude that for Microsoft, the biggest challenge was the sheer scope of the company," says Fitzgerald, who has publicly opined that he thinks Microsoft ought to be three "svelte" companies rather than one single mega-corporation.  Sitting cross-legged in his office chair, Ballmer refuses to concede that Microsoft is too big or in need of any kind of divestiture to succeed.  "I do think we're far more focused than we were when I took over," Ballmer says. "And that's partly a function of the time. We've gone from being a complete leader to a leader and a challenger, both in the same body. And when you're a challenger, you do have to pick and choose and be more focused."  Microsoft employees used to believe "that we could just make things, just develop part of something and it would take off," Ballmer says. These days, "I don't believe that," he says. We'll soon see if that view is one that his successor holds, too.
As Microsoft prepares to announce a new CEO, we ask Steve Ballmer to take a look at the legacy he leaves on the technology company.