Hi,
The SCCM guys have issues with SCCM's TFTP (PXE) functionality on odds days.
I wrote this script that calls the windows tool "tftp.exe" (some code comes from SW's findfile.vbs example)
The script requests a file from the TFTP server, checks if it exists for the downloaded location and then deletes the file.
I'm unable to get it to download the file file when I add the code to the Windows Script monitor........but it works great from the command line in Windows.
My VB is terrible and I'm not sure if I need to tweak something to get it to call the windows command correctly.
I have added the "tftp.exe" app into both C:\temp\tftp and in a windows path location on the Orion server.
Here is the code:
Option Explicit
Const FILE_FOUND = 0, INVALID_PARAMS = 1, FILE_NOT_FOUND = 1
Dim oShell, fileName, fso, monFile
fileName = "\\10.160.8.186\c$\temp\tftp\tftpfile"
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "cmd cd /C C:\temp\tftp & tftp -i 10.160.8.186 get SMSBoot\x86\wdsnbp.com \\10.160.8.186\c$\temp\tftp\tftpfile"
Set fso = Wscript.CreateObject( "Scripting.FileSystemObject" )
' sleep for 5 seconds for file to download
wscript.sleep 5000
If fso.FileExists( filename ) Then
oShell.run "cmd cd /K del \\10.160.8.186\c$\temp\tftp\tftpfile"
WScript.Echo "Message:" & fileName & " :: FOUND - PASS"
WScript.Echo "Statistic: 0"
WScript.Quit( FILE_FOUND )
Else
oShell.run "cmd cd /k del \\10.160.8.186\c$\temp\tftp\tftpfile"
WScript.Echo "Message:" & fileName & " :: NOT FOUND - FAIL"
WScript.Echo "Statistic: 0"
WScript.Quit( FILE_NOT_FOUND )
End If
Any help would be appreciated as I know a few other people would like some sort of TFTP monitor.
Ben