Home > Batch Scripting, Scripting, Windows Server > Administration Automation Part 2:

Administration Automation Part 2:

Sysocmgr is a very very cool tool if you haven’t played with it before, instead of doing a start > run > appwiz.cpl then adding windows components you can script installation of common utilities like IIS, SNMP or even disable the ever annoying Enhanced security in server 2003’s internet explorer.

Sysocmgr functions in three parts,

sysocmgr.exe, sysocmgr.inf and an answer file. The first two you can in %windir%\system32\sysocmgr.exe, %WINDIR%\inf\sysoc.inf and the third file (created by yourself) can be placed anywhere you like.

So how does it work? well here basically:

Sysocmgr.exe /i:%WINDIR%\inf\sysoc.inf /u:”\\servername\share\name.inf” /q /r

/q – runs Sysocmgr.exe in quiet mode (without display pages)
/r – suppresses reboot (if needed)

The above command will run the add remove programs and the commands in the name.inf will tell you it what to do.

One word of warning, you will need to have an i386 folder specified in the source paths before this can be run silently, the below reg keys run through batch will set your install path to c:\i386, just make sure it exists first 🙂

reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v “ServicePackSourcePath” /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v “Installation Sources” /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v SourcePath /f
Reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup” /v SourcePath /t REG_SZ /d “C:” /f
Reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup” /v ServicePackSourcePath /t REG_SZ /d “C:” /f
Reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup” /v “Installation Sources” /t REG_MULTI_SZ /d “C:\” /f

here are some example answer files, each one of these are seperate answer files. Dont try to combine them, it wont work.

Disable hardened IE:

[Components]
IEHardenUser=Off
IEHardenAdmin=Off

Install SNMP:

;SetupMgrTag
[NetOptionalComponents]
SNMP=1
[SNMP]
Any_Host=YES

Install IIS:

[Components]
aspnet=on
complusnetwork=on
dtcnetwork=off
bitsserverextensionsisapi=off
bitsserverextensionsmanager=off
iis_common=on
iis_ftp=off
fp_extensions=off
iis_inetmgr=on
iis_nntp=off
iis_smtp=off
iis_asp=off
iis_internetdataconnector=off
sakit_web=off
tswebclient=off
iis_serversideincludes=off
iis_webdav=off
iis_www=on
appsrv_console=on
inetprint=off

[InternetServer]
PathWWWRoot = C:\Inetpub\Wwwroot

A

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: