vb发送Gmail邮件

使用vb来发送Gmail邮件,配合windows2003的performance来做进程监控,很实用也很方便,进程控制也可以,脚本的主要作用是发送邮件通知,触发动作可由performance来完成.

  1. Set iMsg = CreateObject("CDO.Message")
  2. Set iConf = CreateObject("CDO.Configuration")
  3. Set Flds = iConf.Fields
  4. schema = "http://schemas.microsoft.com/cdo/configuration/"
  5. Flds.Item(schema & "sendusing") = 2
  6. Flds.Item(schema & "smtpserver") = "smtp.gmail.com" 
  7. Flds.Item(schema & "smtpserverport") = 465
  8. Flds.Item(schema & "smtpauthenticate") = 1
  9. Flds.Item(schema & "sendusername") = "YourEmailAddress"
  10. Flds.Item(schema & "sendpassword")"YourPassWord"
  11. Flds.Item(schema & "smtpusessl") = 1
  12. Flds.Update
  13. With iMsg
  14. .To = "Recipients"
  15. .From = "YourName <YourEmailAddress>"
  16. .Subject = "Email Title"
  17. .HTMLBody = "YourMessageGoesHere"
  18. .Sender = "YourName"
  19. .Organization = "YourName"
  20. .ReplyTo = "Recipients"
  21. Set .Configuration = iConf
  22. SendEmailGmail = .Send
  23. End With
  24.  
  25. set iMsg = nothing
  26. set iConf = nothing
  27. set Flds = nothing

windows批处理批量添加IP

使用BAT脚本批量添加IP,省去手工输入的时间。

  1. @echo off
  2. for /l %%a in (2,1,254) do netsh interface ip add address name="Local Area Connection" addr=1.1.1.%%a mask=255.255.255.248

windows2003无法安装mssql2000

windows2003卸载sql2000,再安装的时候报错,以下为解决办法:

  1. 1 重命名C:\Program Files\ 底下的Microsoft SQL Server文件夹
  2. 如: Microsoft SQL Server_bak
  3. 2 查找以下注册表键值并删除
  4. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
  5. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSDTC
  6. 如:在MSSQLServer上右键,点击删除
  7. 3 重启再次安装

windows2003开启防火墙后 ftp一直卡住

公司几台windows2003的服务器,都是企业版,打开系统自带的防火墙,客户反映ftp上来经常会卡住。
解决办法是把ftp设置为被动模式并且指定端口
两种方法,我用第一种实现了,因为做安全的时候把wshom.ocx跟shell32.dll都拿掉了

  1. 1)
  2. 停止iisftp # iisreset /stop
  3. C:\windows\system32\inesrv\MetaBase.xml
  4. CTRL+F 查找 MSDOSDirOutput
  5. 在下面的MaxConnections="100000" 添加一行
  6. PassivePortRange="40000-40020" #指定端口
  7. 启动IIS # iisreset /start
  8. 然后在防火墙把这些端口打开,微软默认是1024-65535,这样很不安全。
  9.  
  10. 2)
  11. c:\Inetpub\adminiscripts\adsutil.vbs set /MSFTPSVC/PassivePortRange "40000-40020"

velikan.net里的这篇文章讲得很详细

windows2003 Event ID:5

windows2003系统日志出现大量event ID为5的错误日志,都是asp引起的
以下设置可以解决:
为C:\windows\Help\iisHelp\common添加network service默认权限
为C:\windows\system32\inetsrv\ASP Compiled Templates添加network service为全部控制

  1. Event Type: Error
  2. Event Source: Active Server Pages
  3. Event Category: None
  4. Event ID: 5
  5. Date: 2010-3-25
  6. Time: 0:34:14
  7. User: N/A
  8. Computer: xxx
  9. Description:
  10. Error: The Template Persistent Cache initialization failed for Application Pool 'brandshipper' because of the following error: Could not create a Disk Cache Sub-directory for the Application Pool. The data may have additional error codes..
  11.  
  12. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
7 «12345»...7