我担心我们的一台服务器由于各种原因而被滥用。
是否有一种工具可以在用户登录服务器时发送电子邮件?
我希望在后台收到一封包含尽可能多的信息的电子邮件。
谢谢
答案1
我在域根级别的 GPO 中使用登录脚本来实现此目的。简化版本可能如下所示:
Set ADSysInfo = CreateObject ("ADSystemInfo")
Set currComp = GetObject ("LDAP://" & ADSysInfo.ComputerName)
Set CurrUser = GetObject ("LDAP://" & ADSysInfo.UserName)
if CurrComp.operatingSystem = "Windows 2000 Server" or _
CurrComp.operatingSystem = "Windows Server 2003" then
' send email via whatever SMTP server/etc you have in place
' this will be different depending on the server so i can't give code
' CurrUser.sAMAccountName - user account name
' CurrComp.cn - name of server being logged on to
endif
您需要在 TechNet 上找到通过脚本发送电子邮件的方法,以弥补其中缺失的部分
答案2
如果是 Server 2008,请创建一个 sch 任务并定义一个“事件触发”触发器。您很可能希望使用 528 作为事件,那么您的操作将是“发送电子邮件”。您需要一个 SMTP 服务器。
http://technet.microsoft.com/en-us/library/cc787567(WS.10).aspx事件 ID。