Can tech companies withstand hard times?

SEATTLE -- How will Silicon Valley make out if the economy slides into recession? Tech suppliers expect to be hit hard. But big winners could quickly start to emerge from the chaos, say tech industry analysts.

With credit scarce and job cuts mounting, consumers and businesses have begun adopting a cautious approach to tech spending.

No one will escape the unfolding economic slowdown, Microsoft msft CEO Steve Ballmer told reporters in Oslo, this week. "I think one has to anticipate that no company is immune to these issues, " Ballmer said.

Yet some tech companies are better equipped than others. Google goog, for instance, which dominates search advertising, should hold steady so long as Web users continue to shop, socialize and do research online. But Yahoo, the leader in brand advertising, could be vulnerable as advertisers trim budgets for image ads.

IBM, ibm Hewlett-Packard hpq and Oracle orcl can hunker down with cash pouring in from a diverse array of corporate and government contracts; they also stand to earn billions helping the credit industry reconstitute itself.

Not so much Sun Microsystems javad, which has been heavily reliant on sales to the troubled financial firms, notes Charles King, analyst at Pund-IT Research. In its quarterly report, filed Aug. 1, Sun warned that "slowing performance in the U.S." could have an impact on "top-line revenue growth."

Meanwhile, Microsoft will continue to rake in huge profits from corporate licenses for Windows and Office. The software titan recently designated $40 billion to buy back company shares; it has $24 billion in cash, no debt and few distractions, having failed in its attempted hostile takeover of Yahoo. "Not buying Yahoo yhoo looks better and better all the time," says RedMonk analyst James Governor.

As companies trim in-house tech staffs, Microsoft could see demand heat up for its new line of hosted business services, with which it hopes to compete against the likes of Salesforce.com crm and NetSuite n, says Directions on Microsoft analyst Paul DeGroot.

The credit squeeze "is highlighting the wisdom" of renting software and data storage hosted on computer servers managed by the tech supplier, says DeGroot. New hosted business services from Amazon amzn, Google and Yahoo should "become more popular replacements for the on-premise data center," he says.

Firms such as Symantec symc, SecureWorks and Kaspersky Lab should also see demand increase for their security systems. Rob Enderle, analyst at Enderle Group, says cyberintrusions of corporate systems can be expected to rise during a downturn. "Security has become a nightmare," he says, adding that corporate defenses are "massively substandard."

Contributing: Reuters