Jump to content

StewartKnight

Members
  • Posts

    1,680
  • Joined

Everything posted by StewartKnight

  1. Thats what happened to the famous missing discs!
  2. I got an xbox because I wanted to play Halo 3, imagine my disappointment when I discovered that you need the hard drive to play with someone (ask ZeroHour!)! I am tempted to get Virtua Fighter 5 so that I can kick ass online. Does anyone know (TinyChip I'm looking at you!) if you need the hard drive for that too?
  3. I agree gwendes! Perhaps we should make newbies take an IT test!
  4. that sounds like a DNS error to me, either that or the IP address is screwy!
  5. I provide support to feeder primarys. The way I see it, I will fix anything broken, I will install new equipment if desperately required. I will NOT install software or create user accounts etc. There is a difference between supporting schools and becoming a part time primary technician!
  6. wow! I thought I was "reds under the beds" andy! I like the way you're thinking!
  7. I agree tech_guy if I saw coffee spilt I'd hit the power off, not remote shutdown! As for the noise.... switch it off again. Take the cover off see if there is coffee anywhere, and clean it if there is wait till monday before switching it on! If the machine booted before, at least the electronics aren't fried!
  8. you after my job cooke monster???
  9. the wording smacks of sales speak, and he only registered to post that comment!
  10. what can I say, it's a great school to work for and it's in a rural town in the Lake District, so the views and standard of living are top notch!
  11. Why does worrock88 smell like spam?
  12. Whats the difference between the England football team and Lewis Hamilton? Next year, Hamilton will still be with McLaren! Throws hat into ring...... Mark Hughes for England manager!
  13. I pretty much come and go as I please!
  14. If I bought a car, and they told me I couldn't add alloy wheels or a new stereo, I'd be annoyed. If I add a chip (I haven't) to my xbox360 to play game from America before they are released here, they'd ban me! Once I've bought an xbox... it should be mine to do with as I like. Adding a chip does not violate intellectual property. I'm sick of companies, like Microsoft and Apple, telling us what we can and can't do with our owm property. I did not pay hundreds of pounds to rent my console from Microsoft!
  15. Typical whinging self obsessed aussie! Is it true that the only culture in Australia is yogurt?
  16. I have a cheap dell that makes Fedora 8 look fantastic!
  17. 'deviceStatus_v2-9.vbs. 'A script to check the availability of computers specified in a file, on the network. 'Created 01/05/2007 'By Stewart Knight 'Option Explicit is used to prevent the script from running if it comes across an error. Option Explicit 'This is where the variables are declared. Dim objShell, objExec, strTarget, strPingResults, objFSO, objFile Dim objCreate, strDevice, strComputer, objWMIService, colPings Dim objPing, objResult, objEmail, objReadFile,inpAddress,inpFileName Dim objCheckFileExists, objFileSystemObject, objMailAddress, objDictionary Dim objPersistant, objReadAllErrors, objCompareError, objCheckErrors Dim strCheck2, strCheck1, strCheck3, strCompare1, strCompare2, strCompare Dim varLoop 'This is the main section of the script, where all the functions are called. createDictionary checkFile checkErrors compareLogs mailSend 'This is where the functions are defined. Function execPing 'This is the routine that pathpings the computers from the file strTarget. Set objShell = CreateObject("WScript.Shell") Set objExec = objShell.Exec("pathping " & strTarget) strPingResults = LCase(objExec.StdOut.ReadAll) If InStr(strPingResults, "reply from") Then ExecPing = True Else ExecPing = False End If End Function Function checkFile 'This checks that the file for the list of computers exists. Set objFileSystemObject = CreateObject("Scripting.FileSystemObject") If (objFileSystemObject.FileExists("CS.txt")) Then objCheckFileExists = True Else objCheckFileExists = False End If 'This outputs an error message if the file does not exists, then terminates the script. On Error Resume Next If objCheckFileExists = False Then WScript.Echo "Unable to find file" WScript.Quit End If 'This collect the names of the computers from the file and uses the Function 'execPing to check if they are available. set objFSO = CreateObject("Scripting.FileSystemObject") set objFile = objFSO.OpenTextFile(inpFileName, 1) set objCreate = objFSO.CreateTextFile("c:\results.txt", 2) Do While Not objFile.AtEndOfStream strDevice = objFile.ReadLine strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colPings = objWMIService.ExecQuery _ ("Select * From Win32_PingStatus where Address = '" & strDevice & "'") If Err = 0 Then Err.Clear For Each objPing in colPings If objPing.StatusCode = 0 Then objResult = strDevice & " available." & "IP Address: " & objPing.ProtocolAddress Else objResult = strDevice & " not available." End If Next Else Err.Clear If ExecPing = True Then GetName End If End If objCreate.WriteLine(objResult & ": " & Now) Loop objFile.Close objCreate.Close 'Confirms that pathping has run successfully. wscript.echo "The output has been saved into the file 'results.txt'." End Function Function checkErrors 'This opens a log file of all the computers that have been checked. 'It then checks to see which were unavailable, and stores that information 'in an error file and a dictionary file. set objFSO = CreateObject("Scripting.FileSystemObject") set objFile = objFSO.OpenTextFile("c:\results.txt", 1) set objCreate = objFSO.CreateTextFile("c:\errors.txt", 2) set objDictionary = objFSO.OpenTextFile("c:\Persistant.txt", 8) Do While Not objFile.AtEndOfStream strDevice = objFile.ReadLine If InStr(strDevice, "not") Then objCreate.WriteLine strDevice If InStr(strDevice, "not") Then objDictionary.WriteLine strDevice Loop objFile.Close objCreate.Close objDictionary.Close 'Confirms that the procedure has completed, and that the data has been output. wscript.echo "The unavailable computers are listed in the file 'errors.txt.'" End Function Function mailSend 'This Checks that there is an email address to email the file to. inpAddress = inputbox("Enter the email address") Set objFileSystemObject = CreateObject("Scripting.FileSystemObject") If inpAddress <> "" Then objMailAddress = True Else objMailAddress = False End If 'This handles the error if there is no email address. On Error Resume Next If objMailAddress = False Then WScript.Echo "No email Address was entered, this log has not been emailed." WScript.Quit End If 'This is the email routine. Set objEmail = CreateObject("CDO.Message") objEmail.Subject = "Unavailable computers" objEmail.From = "[email protected]" objEmail.To = inpAddress objEmail.TextBody = "The computers in the attached file were unavailable when this VB Script was run." objEmail.AddAttachment "c:\end.txt" objEmail.Send 'Confirms that the email has been sent. WScript.Echo "The list of computers that are not available has been emailed to: " _ & inpAddress End Function Function createDictionary 'The purpose of this is to check if the dictionary file exists, 'if it does not, then it creates one. Set objFSO = CreateObject("Scripting.FileSystemObject") On Error Resume Next Set objPersistant = objFSO.OpenTextFile ("c:\persistant.txt", 8) Set objPersistant = objFSO.CreateTextFile("c:\persistant.txt",8) objPersistant.Close End Function Function compareLogs 'The error log is compare to the dictionary to see if the device has failed before. 'The output is then stored in a file to be emailed to the specified address. Set objFSO = CreateObject("Scripting.FileSystemObject") Set strCheck1 = objFSO.OpenTextFile("c:\errors.txt") Set strCheck2 = objFSO.OpenTextFile("c:\persistant.txt") Set strCheck3 = objFSO.CreateTextFile("c:\end.txt",2) Do While Not strCheck1.atEndOfStream strCompare1 = strCheck1.ReadLine Set strCheck2 = objFSO.OpenTextFile("c:\persistant.txt") Do While Not strCheck2.atEndOfStream strCompare2 = strCheck2.ReadLine If inStr(strCompare1,10) = inStr(strCompare2,10) Then strCheck3.WriteLine strCompare2 _ & " Failed again at " & Now Loop strCheck2.Close Loop strCheck1.Close strCheck3.Close End Function 'End of Script
  18. how much do they pay? *I'll get my coat*
  19. I don't know if this is what you're looking for, but I have a script, that you set to run at a given time. This checks which computers are still switched on. It then emails me the details of any that have infringed my script.
  20. is port 43 open on the firewall?
  21. How about setting up a vlan, with only authenticated MAC address being allowed access to the system?
  22. Tim and I had reason to discuss this on Thursday. We seemed to recall that BECTA guidelines were 1 flat network (admin and ciricculum combined) Does anyone know where I could find the BECTA document that discusses joining the ciricculum and admin networks together?
  23. I got mine from videk. Very good equipment!
  24. I had to fit a new hard drive in the end!
  25. Taking that argument further, you'd be breaking copyright by going to America, and seeing a film that hasn't been released in England yet!
×
×
  • Create New...