You can install pretty much any windows component locally or remotely on a server. Here is an example of installing SNMP using an answer file via command line locally on a server:
1 |
sysocmgr /i:%windir%\inf\sysoc.inf /u:"<a href="file://server/share/snmp.txt">\\server\share\snmp.txt</a>" /q |
This will install SNMP quietly using the answer file I give it which is located on a file share. Here are the contents of the answer file:
1 2 3 4 5 6 7 8 9 |
[NetOptionalComponents] SNMP = 1 [SNMP] Send_Authentication = Yes Accept_CommunityName = mine_ro:Read_Only Any_Host = No Limit_Host = xxx.xxx.xxx.xxx |
This will automatically configure a new read only community you specify and add a single host that is allowed to connect (you can add more IPs but adding a comma after each one). The only dilemma is that during the install, it needs to get at the i386 directory and by default in the registry, it is pointed to “D:/i386” more than likely since that is typically the CD-ROM drive you installed the OS from. We just need to run a quick registry update to two keys that point it to the C: drive before running the line above and it should work with no issue. This can be done in bulk on servers too using whatever remote management tool you prefer:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\ CurrentVersion\Sourcepath
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows \CurrentVersion\Setup\Sourcepath
Keep in mind sysocmgr.exe has been replaced in Server 2008 by ocsetup.exe. You can read up on command line switches for it here:
http://technet.microsoft.com/en-us/magazine/dd673656.aspx
http://technet.microsoft.com/en-us/library/cc766272(WS.10).aspx
Jason Samuel is a visionary product leader and trusted advisor with a proven track record of shaping strategy and driving technology innovation. With extensive expertise in enterprise end-user computing, security, cloud, automation, and virtualization technologies, Jason has become a globally recognized authority in the IT industry. His career spans consulting for hundreds of Fortune 500 enterprises across diverse business sectors worldwide, delivering cutting-edge digital solutions from Citrix, Microsoft, VMware, Amazon, Google, and NVIDIA that seamlessly balance security with exceptional user experiences.
Jason’s leadership is amplified by his dedication to knowledge-sharing as an author, speaker, podcaster, and mentor within the global IT and technology community. Recognized with numerous prestigious awards, Jason’s contributions underscore his commitment to advancing technology and empowering organizations to achieve transformative results. Follow him on LinkedIn.
sune alexandersen
January 12, 2012 at 10:41 AM
How would I do this remotely via Powershell on 2003 ?
🙂
Jboss
May 12, 2012 at 7:12 AM
Extremely helpful article on automating SNMP install! For 2008 R1 one could use
ServerManagerCmd -install SNMP-Services -allSubFeatures
to automate the SNMP installation.