FastCGI timeout value change

By default IIS7 doesn't have a icon to control FastCGI, but you can modify the values in the command line.  I'm using php as the example as that is the most common use for FastCGI.

appcmd set config -section:system.webServer/fastCgi /[fullPath='C:\php\php-cgi.exe'].activeTimeout:600

Replace the fullPath with your actual executable path.  The Timeout value is in seconds, so this sets it to 10 minutes.

Check to see if the values were imput correct with this command:

appcmd list config -section:system.webServer/fastCgi

cmd

You can also use Microsoft's installer for php.  This will give you a FastCGI icon in IIS you can use to configure these settings.

 

SQL Server error "The application has failed to start because its side-by-side configuration is incorrect."

After the December windows updates I had issues with a few SQL instances for products like McAfee's EPO.  The services would not start up, and the SQL 2005 patches would fail to install.  I received the following error:

The SQL Server (Server Name) service failed to start due to the following error: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.

Turns out reinstalling the Visual C++ redistributable will correct the issue and allow the service to start.  After starting the service the patches will install correctly.

vbscript for DNS Changes and Windows Firewall

I've been working in an environment does not have DHCP. That has presented some challenges with migrating AD to new servers, and moving DNS servers.

Code:

strComputer = "."
 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
 
Set colNetCards = objWMIService.ExecQuery _
    ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True and DHCPEnabled = False")
 
For Each objNetCard in colNetCards
    arrDNSServers = Array("xxx.xxx.yyy.yyy","xxx.xxx.yyy.yyy","xxx.xxx.yyy.yyy")
    objNetCard.SetDNSServerSearchOrder(arrDNSServers)
Next

This script checks to see if the interface and DHCP is disabled and then changes the DNS servers to the defined values. Not perfect but it was the best option I had. Walking to every network device didn't sound like fun.

Another useful one for changing IP addresses in non-DHCP environments:

Code:

' This code configures an IP address, subnet mask and default gateway
' for the specified connection.
' ---------------------------------------------------------------
' From the book "Windows Server Cookbook" by Robbie Allen
' ISBN: 0-596-00633-0
' ---------------------------------------------------------------
 
' ------ SCRIPT CONFIGURATION ------
strComputer = "."
strConnection = "Local Area Connection"
strIP = Array("1xxx.xxx.xxx.yyy")
strMask = Array("1xxx.xxx.xxx.yyy")
strGatewayIP = Array("1xxx.xxx.xxx.yyy")
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colNA = objWMI.ExecQuery("select * " & _
                            " from Win32_NetworkAdapter " & _
                            " where NetConnectionID = '" & strConnection & "'" )
for each objNA in colNA
   set colNAConfig = objWMI.ExecQuery _
      ("ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID='" & _
        objNA.DeviceID & "'} " & _
      " WHERE resultClass = win32_NetworkAdapterConfiguration ")
   for each objNAConfig in colNAConfig
      intRC = objNAConfig.EnableStatic(strIP,strMask)
      intRC2 = objNAConfig.SetGateways(strGatewayIP)
      if intRC = 0 and intRC2 = 0 then
         WScript.Echo "IP address configured for " & strConnection
      elseif intRC = 1 or intRC2 = 1 then
         WScript.Echo "You must reboot for the changes to take effect for " & _
                      strConnection
      else
         WScript.Echo "There was an error configuring IP for " & _
                      strconnection & ": " & intRC & " and " & intRC2
      end if
   next
next

The other issue I've had to overcome is the Windows firewall gets enabled by Windows updates. Sure you can configure group policy to disable it, but often the policy would take to long to apply and users would call with software issues.

Code:

Set WshNetwork = WScript.CreateObject("WScript.Network")
'get reference to ADSI computer object
Set objComputer = GetObject("WinNT://" & WshNetwork.ComputerName & ",computer")
 
'get ref to a specific service
Set objService = objComputer.GetObject("service", "SharedAccess")
 
'set starttype
'0 boot
'1 system
'2 automatic
'3 manual
'4 disabled
If objService.StartType = 2 Then
  Set objFirewall = CreateObject("HNetCfg.FwMgr")
  Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
 
  objPolicy.FirewallEnabled = FALSE
  'msgbox("firewall disabled")
End If
Set objService = Nothing

I'm totally against disabling the Windows firewall, but certain vendors refuse to work with it.

« 1 2 3 4 5 6 7 8 9 10 11 12 »