Tech Line

Windows Component Quandary

With sysocmgr.exe, you can install optional Windows components from the command line.

Chris: I've finished reading your article, "Add/Remove Programs Problem," and it was very helpful, so I'll take this advantage to thank you for that one. But I have a little question, I'm looking for a simple way to install some components in the "add/remove windows components" - "Print Services for UNIX" for example, in a simple way so I'll be able to publish it by GPO or any other script.

Could you please give me a hint on this one?
— Lior

Tech Help—Just An
E-Mail Away

Got a Windows, Exchange or virtualization question or need troubleshooting help? Or maybe you want a better explanation than provided in the manuals? Describe your dilemma in an e-mail to the MCPmag.com editors at mailto:[email protected]; the best questions get answered in this column and garner the questioner with a nifty MCPmag.com baseball-style cap.

When you send your questions, please include your full first and last name, location, certifications (if any) with your message. (If you prefer to remain anonymous, specify this in your message, but submit the requested information for verification purposes.)

Lior, when I first saw the “thank you” in your e-mail, my mind immediately shifted into “What’s coming next?” mode. This is because whenever my wife starts any sentence directed at me with something positive such as “Hey Honey…” it means I’m about to do something.In your case, I’m just answering a question. At home, this usually means that it’s time to take out the trash.

Anyway, you pose an excellent question on the extended use of sysocmgr.exe. While it can be used to remove programs, it’s also an excellent tool for installing optional Windows network components. The Microsoft KnowledgeBase Article 222444, “How to Add or Remove Windows Components with Sysocmgr.exe,” provides a pretty good overview of the process, but does not offer specific guidance on the requirements for remotely installing optional networking components.

To use this tool to install optional Windows components, you first need to create an unattended.txt file. The unattended.txt file requires two sections: [components] and [NetOptionalComponents]. The [components] section needs to have the line netoc=on. This tells the installer to process the components listed in the [NetOptionalComponents] portion of the file. In your case, to use this tool to install Print Services for UNIX, you would need to add the line lpdsvc=1 to the [NetOptionalComponents] section. Setting a listed service to 1 tells the installer to install the service, while setting the service to 0 would tell the installer to uninstall the service. So in your case, the completed unattended.txt file would look like this:

[components]
Netoc = on

[NetOptionalComponents]
lpdsvc = 1

With the untattended.txt file saved, you'd then run the sysocmgr.exe command to install the optional components. The most popular syntax for this tool is:

sysocmgr.exe /i:<sysoc.inf file path> /u:<unattended.txt file name> /q

The /i switch points the command to the location of the sysoc.inf file, while /u identifies the unattended.txt file. The /q switch is optional and can be used to run the command in quiet mode, which suppresses the Windows Components Wizard from being displayed when the program executes. The /q switch is especially handy when sysocmgr.exe is being run via a script. Here’s an example using this command:

sysocmgr /i:sysoc.inf /u:unattended.txt /q

If you’re wondering about the required syntax to install other optional networking components such as DNS or DHCP, you can find all possible values for the [NetOptionalComponents] section in an unattended.txt file in the TechNet article “[NetOptionalComponents] (Sysprep).”

Keep in mind that to use this tool via a script, the Windows set-up files and/or service pack files will need to be accessible either locally or over the network. Both the set-up files and service pack locations can be altered on any system by editing the registry. To change the locations of the set-up files, navigate to the HKLM\SOFTWARE\Microsoft\Windows\Current Version\Setup key and change the “Installation Sources” and “ServicePackSourcePath” values to reference the appropriate locations. These values can also be modified using a script. Samples of using a VBscript to edit Registry values can be found in the TechNet Script Repository.

One other approach to consider would be to use Wininstall LE to create MSI packages for deployment with a GPO. The latest version of Wininstall LE can be downloaded here.

Hopefully these ideas will get you pointed in the right direction. Now, I’ll go take out the trash!

About the Author

Chris Wolf is a Microsoft MVP for Windows --Virtual Machine and is a MCSE, MCT, and CCNA. He's a Senior Analyst for Burton Group who specializes in the areas of virtualization solutions, high availability, storage and enterprise management. Chris is the author of Virtualization: From the Desktop to the Enterprise (Apress), Troubleshooting Microsoft Technologies (Addison Wesley), and a contributor to the Windows Server 2003 Deployment Kit (Microsoft Press).learningstore-20/">Troubleshooting Microsoft Technologies (Addison Wesley) and a contributor to the Windows Server 2003 Deployment Kit (Microsoft Press).

comments powered by Disqus
Most   Popular