In a previous post (PowerShell v2 Gather remote software inventory), I lamented the fact that Server 2003 does not include the Win32_Product class by default. (http://blogs.msdn.com/wmi/default.aspx)

I was asked to install it on our 500 Server 2003 boxes via a script.

I built a few test VM’s, and configured the Win32_Product class via “Add/Remove Windows Components”

Doing so, I found that the following three files are required by the “Management and Monitoring Tools”

MSI.MFL
MSI.MOF
MSIPROV.DLL

I copied the three (compressed) files from the AMD64 directory on my installation disk to my script folder.

From various sources on the Internet, I discovered I could install it from a command line as: Sysocmgr /I:\c:\windows\inf\sysoc.inf /u:<AnswerFile> where AnswerFile is:

[Components]
WbemMSI = On

My first attempts were to use the WMI class Win32_Process to run the command as

$process

= ([WMICLASS]"\\$server\ROOT\CIMV2:Win32_Process").Create(“Sysocmgr /I:\c:\windows\inf\sysoc.inf /u:\\mypc\c$\answerfile.txt”)

, but that was problematic, as sysocmgr didn’t seem to like having the answerfile on a remote path.

I copied the answerfile.txt to the remote computer, and ran the command, but it still didn’t work. Researching the issue on Bing, and looking in the log file  “C:\windows\setupapi.log”,  I realized the process was waiting for the CD to be inserted.

More time on Bing made me realize the the remote server registry would need to be manipulated for me to provide the files on an alternate path.

I figured the easiest way to provide the three files I needed was to copy them each remote server, modify the registry to point to that location, and run the command again. This almost worked. Now I got errors in the setupapi.log saying my files weren’t signed. These files came right off the CD, so I wasn’t about to try signing them, and I wasn’t about to believe they weren’t signed by Microsoft (if they truly needed to be).

I DID find out that I could expand them on the target machine, and then install them remotely, so I created a .bat file to do that. I also figured I might as well have the .bat file run the the sysocmgr line too.

 

Here is the .bat file that I copy to each remote server:

READ it first!
Turn off Computer missing
For XP Professional:

- Click [Start] [Run] type [Gpedit.msc]
- [User Configuration] [Administrative Templates] [Start Menu and Taskbar]
- In the right pane, double-click "Remove and disable the Turn off computer
button" and set it to "Not Configured"
- Set "Remove and prevent access to Shutdown command" to "Not Configured"
- Restart
More information:
http://support.microsoft.com/default.aspx?kbid=307882
For XP Home:
Open Registry Editor (Regedit.exe)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Set the NoClose value to 0
http://is-it-true.org/nt/xp/registry/rtips41.shtml

Ramesh ( SRamesh2k.RemoveThis@hotmail.com)
http://www.angelfire.com/dragon/sramesh2k/

Special Solution




Source
When you click Start Menu, the Turn Off Computer option may be missing. This is due to a group policy / registry restriction. To restore the missing option, try this - for stand-alone systems:
Resolution
NOTE: Backup the Registry before modifying. See this article for more information.
  • Open Registry Editor by typing REGEDIT.EXE in the Start, Run dialog.
     
  • Navigate to the following locations:
HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer