Print Page | Close Window

Suggestion

Printed From: ForensiT
Category: ForensiT Support
Forum Name: Domain Migration
Forum Discription: User Profile Wizard questions, suggestions, comments and bug reports
URL: http://forum.ForensiT.com/forum_posts.asp?TID=153
Printed Date: 13 Oct 2019 at 3:00pm


Topic: Suggestion
Posted By: IH82LUZ
Subject: Suggestion
Date Posted: 05 Jan 2009 at 11:10am
This might have been covered before, but I thought it might be useful information for some people who are starting to migrate their company over to AD.
 
We have our users run a script that launches the migration process.  Periodically this script fails and either the user doesn't tell us or they call us and can't fully explain what the problem is.  What I did was created a VB script called email.vbs. What this does is email me that the process failed and it attaches the log file.  The email comes from their user name on the computer @ the domain, the log file is attached, and it has their computer name in the body of the email. It's greatly helped my troubleshooting.  Here is what's in my email.vbs, not very complicated:
 
on error resume next
wscript.sleep 5000
Set objNetwork = CreateObject("WScript.Network")
sUserID = objNetwork.UserName
sCompID = objNetwork.ComputerName
Dim OBJMail
Set objEmail = CreateObject("CDO.Message")
objEmail.From = sUserID & "@<DOMAIN.COM>"
objEmail.To = "<MAILRECIPIENT>"
objEmail.Subject = "Active Directory Migration Failed"
objEmail.Textbody = "Migration Failed" & Chr(13) & Chr(10) & "Computer Name is: " & sCompID
objEmail.AddAttachment "C:\forensit\migrate.log"
objEmail.Configuration.Fields.Item _
 (" http://schemas.microsoft.com/cdo/configuration/sendusing - http://schemas.microsoft.com/cdo/configuration/sendusing ") = 2
objEmail.Configuration.Fields.Item _
 (" http://schemas.microsoft.com/cdo/configuration/smtpserver - http://schemas.microsoft.com/cdo/configuration/smtpserver ") = _
"imail2.noridian.com"
objEmail.Configuration.Fields.Item _
 (" http://schemas.microsoft.com/cdo/configuration/smtpserverport - http://schemas.microsoft.com/cdo/configuration/smtpserverport ") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
 
I then injected this code in the Migrate.vbs in the line right after "MsgBox strMessage, Icon, "User Profile Migration Script"
objWshShell.run "wscript.exe C:\forensit\email.vbs"
 
Now if the Migration fails for someone, I get an email with the log file attached and the PC name. Hope this helps anyone.
 
Rob


-------------
Thanks,
Rob



Print Page | Close Window