Cybercriminals took advantage of unsecure supply chains to install the harmful software, the company said.
A supply chain becomes unsecure when distributors or resellers receive or sell products from unauthorized sources.
Microsoft called its discovery “disturbing,” and warned consumers to be cautious of deals that seem to good to be true.
The company found that 20 percent of the PCs researchers bought from unsecure supply chains were infected with preinstalled malware. The malware was especially dangerous because it could be spread easily via removable devices, like USB drives.
The company's investigation, called "Operation b&0," led to the shutdown of the harmful system that was connected to the computers and infecting them with "Nitol," the malware that was coming preinstalled on the computers.