Switch ASP.Net with 32 bits

Today, when I am trying to check the VPS client server and getting error of services unavailable all of the time.

As I do not know what is being installed earlier, hence I am checking it’s PHP and ASP.Net version. Finally, it is found out the problem came from the ASP.Net.

As the VPS is running Hyper-V with VPS, hence a 64 bits OS used. Hence changing the ASP.Net to 32 bits could get it fixed.

By changing the ASP.Net from 64 bits to 32 bits, you may refer to the step as below.
1. Open a command prompt.
2. Enable the 32 bits environment.

cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

3. Reapply the ASP.Net.

%SYSTEMROOT%\Microsoft.NET\Framework64\vx.xxx\aspnet_regiis.exe -i

where the x.xxx version is your .Net Framework version.

Switch from 64 bits to 32 bits in Windows Server 2003

People always discuss if the apps could support in 64 bits server since the 64 bits server arrive to the market and you might not know that the Windows server ASP and ASP.Net could be turn from 64 bits to 32 bits.

To convert your IIS to be used 32 bits apps, open a command prompt and run the following command.
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

So, now your 64 bits server(IIS) could run 32 bits application without any issue. And you will now need to register the 32 bits .Net Framework as 32 bits framework is not installed by default.
%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

Well done, you have done for all.

WScript: Get Email when disk space low

Yesterday, Mick Genie come out a script to generate the free space from your computer, and it might useful for you for certain purpose.

However, I have think off if this is very inconvenience if you need to login to the computer for every time.

Hence I have come out another script to use IIS SMTP server to send an email to you when the disk space is low.

Set objMessage = CreateObject(“CDO.Message”)
objMessage.Subject = “Disk Space Alert: ServerName”
objMessage.From = “Disk Space Alert<Disk Space Alert>”
objMessage.To = “[email protected]

Dim objShell, space_value, Result
Set objShell = Wscript.CreateObject(“WScript.Shell”)

Set DiskSet = GetObject(“winmgmts:{impersonationLevel=impersonate}”).ExecQuery (“select * from Win32_LogicalDisk where DriveType=3″)
For each Disk in DiskSet
If (Disk.Name=”D:”) Then
Disk.FreeSpace=Disk.FreeSpace/1024
Disk.FreeSpace=Disk.FreeSpace/1024
Disk.FreeSpace=Disk.FreeSpace/1024
Result = Disk.FreeSpace
End If
Next
space_value = Result
Wscript.echo space_value
if space_value < 30 then

objMessage.TextBody = “Server Disk Space Low, ” & space_value & ” GB”
objMessage.Configuration.Fields.Item (“http://schemas.microsoft.com/cdo/configuration/sendusing”) = 2
objMessage.Configuration.Fields.Item (“http://schemas.microsoft.com/cdo/configuration/smtpserver”) = “127.0.0.0”
objMessage.Configuration.Fields.Item (“http://schemas.microsoft.com/cdo/configuration/smtpserverport”) = 25
objMessage.Configuration.Fields.Update
‘objMessage.Send

end if

You need to change the Subject, From, To, Email IP, and port only.

Note: This script tested only work with 32bits box, but not 64 bits box.  Save this file to anyname.vbs will do.