You are in luck, I had to do this when we went from Exchange to Notes.
Copy to a notepad file and save as a VBS
Add to your login script, so it runs when they sign in.
FYI: systems will run slow, as a full scan is taking place.
Result of the scan is emailed to you, so create a mail rule to drop them into a folder.
You will need to update the IP information and the SMTP name
If you don't VBScript, have another person review it.
Run script at your own risk, provided AS IS. Always run on a test box before testing on live systems.
On Error Resume next
Set fso = CreateObject("Scripting.FileSystemObject")
Set objComputer = CreateObject("Shell.LocalMachine")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & strComputer & "rootCIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk",,48)
Set IPConfigSet = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
'Check for logfile on remote system
Check4File
'Check to see if this is an internal Address
CheckIP
'loop through Drives and scan for PST files when description is Local Fisked Disk
For Each objItem in colItems
If objItem.Description ="Local Fixed Disk" Then
objStartFolder= objItem.DeviceID&""
Set objFolder = FSO.GetFolder(objStartFolder)
Set colFiles = objFolder.Files
For Each objFile in colFiles
If UCASE(Right(objFile.Name,4)) = UCase(".nsf") Then
fileinfo = objStartFolder&objFile.Name & " " & objfile.Size
UpdateLogFile(fileinfo)
End if
Next
ShowSubfolders FSO.GetFolder(objStartFolder)
End If
Next
'Create Check File to idwentify that script completed
CreateCheckFile
'Email Results
EmailFiles objComputer.MachineName,"C:"&objComputer.MachineName&".log"
WScript.Sleep 5000
'Delete Copied Files
DeleteFiles
'Clear Memory
ClearMemory
'Quit
WScript.Quit
'***************************************Start Sub and Function Processes********************************
Sub Check4File
If Not FSO.FileExists("C:"&objComputer.MachineName&".log") Then
FSO.CreateTextFile("C:"&objComputer.MachineName&".log")
else
ClearMemory
WScript.Quit
End If
End Sub
Sub CheckIP
Internal = "No"
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
If InStr(IPConfig.IPAddress(i),"xx.x") Or InStr(IPConfig.IPAddress(i),"xx.x") Or InStr(IPConfig.IPAddress(i),"xx.x") Then
Internal = "Yes"
End if
Next
End If
Next
If Internal = "No" Then
If Not FSO.FileExists("C:OffNetwork.log") Then
FSO.CreateTextFile("C:OffNetwork.log")
End If
ClearMemory
WScript.Quit
End if
End Sub
Sub UpdateLogFile(Path)
Set logfile = FSO.OpenTextFile("C:"&objComputer.MachineName&".log",8)
logfile.WriteLine Path&vbCrLf
logfile.Close
End Sub
Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
Set objFolder = FSO.GetFolder(Subfolder.Path)
Set colFiles = objFolder.Files
For Each objFile in colFiles
If UCASE(Right(objFile.Name,4)) = UCase(".pst") Then
fileinfo=Subfolder.Path&""&objFile.Name & " " & objfile.Size
UpdateLogFile(fileinfo)
End if
Next
ShowSubFolders Subfolder
Next
End Sub
Sub CreateCheckFile
FSO.CreateTextFile("C:PSTTask.log")
End Sub
Sub Emailfiles(System,Attachme)
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "email@"
objEmail.To = "email@"
objEmail.Subject = "PSTScan File"
objEmail.Textbody = "Here is the file attachment for "& System
objEmail.AddAttachment Attachme
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "emailserver"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
End Sub
Sub DeleteFiles
fso.DeleteFile("C:"&objComputer.MachineName&".log")
FSO.DeleteFile("C:PSTScan.vbs")
End Sub
Sub ClearMemory
Set fso = Nothing
Set objComputer =Nothing
Set objWMIService = Nothing
Set colItems = Nothing
Set objFolder = Nothing
Set colFiles = Nothing
Set logfile = Nothing
End Sub
'****************************************End Sub and Function Processes*********************************