Course Project

     Course ProjectBy Michael Tsui     COMP230Professor Joe Njoloma    Table of Contents Introduction ………………………………………………………………………………………3Description of program (script) …………………………………………………………………..3Source Code with detailed comments ……………………………………………………………4Screenshots of the output ……………………………………………………………………….

..5Conclusion ……………………………………………………………………………………….6Works Cited ……………………………………………………………………………………..

.7   IntroductionMy company is currently planning to automate many different system administration tasks. My manager has asked me to research a system administration task and implement it using VBScript.

In addition, my manager would like to see both a proposal that describes the system administration task and a complete VBScript solution with sample output runs.     Description of program (script)            I am going to create a comprehensive script that will complete all the indicated automation tasks as a system administrator.  As a FBI forensics technician, I need to be able to copy and duplicate files, as well as creating new files in the FBI database.  I would need to archive completed cases and make room for new ones.

  I would need to find information about different files and their properties.  In short, I am to automate all the file management items to ease my coworkers’ tasks. Source CodeThe first thing when we receive a suspect’s computer is to copy the contents of their hard drive to our testing environment.  In order to do so, I would copy the files from their C: Drive to our F: Drive.  But before I do that, I would want to check the properties of their drives and the number of drives.  set colDrives = objFSO.Drivesfor each objDrive in coldDriveswscript.

echo “Drive: ” & objDrive.driveLetterwscript.echo “Size: ” & objDrive.totalSize/1024*2 & “MB”nextThis is to check the drive’s properties.

  set objDrive = objFSO.Drives(“C:”)wscript.echo “Size: ” & objDrive.

totalSize/1024*2 & “MB”wscript.echo “AvailableSpace: ” & objDrive.AvailableSpace/1024*2 & “MB”wscript.echo “DriveType: ” & objDrive.drivetypewscript.echo “FreeSpace: ” & objDrive.FreeSpace/1024*2 & “MB”wscript.echo “Filesystem: ” & objDrive.

Filesystemwscript.echo “isReady: ” & objDrive.isReadywscript.echo “Path: ” & objDrive.Pathwscript.echo “RootFolder: ” & objDrive.Rootfolderwscript.

echo “SerialNumber: ” & objDrive.SerialNumberwscript.echo “ShareName: ” & objDrive.ShareNamewscript.echo “VolumeName: ” & objDrive.

VolumeNameNow that I see the properties of the drive I can copy the drive’s content.const OverWriteFiles = TrueSet objFSO = CreateObject(“Scripting.FileSystemObject”)call objFSO.

copyfolder(“C:*.*” /s, “F:”, OverWriteFiles) After copying the content, I can examine individual files and folders and their properties.if objFSO.FolderExists(“c:TestFolder”) thenset objFile = objFSO.GetFile(“c:windowssystem32scrrun.dll”)wscript.echo “Data Created: ” & objFile.DateCreatedwscript.

echo “Date Modified: ” & objFile.DataLastModifiedwscript.echo “Drive: ” & objFile.

Drivewscript.echo “Name: ” & objFile.Namewscript.echo “Path: ” & objFile.

Pathwscript.echo “Size: ” & objFile.Sizewscript.echo “Type: ” & objFile.Typeelsewscript.echo “file can’t be found”end ifI can check the suspect’s computer system information.

Set WshShell = WScript.CreateObject(“WScript.Shell”)    WScript.

Echo “The computer name is ….

….

. ” & _      WshShell.ExpandEnvironmentStrings(“%COMPUTERNAME%”)    WScript.Echo “The Num of CPUs is ..

…….

….. ” & _      WshShell.ExpandEnvironmentStrings(“%NUMBER_OF_PROCESSORS%”)    WScript.

Echo “The Processor Architecture is … ” & _      WshShell.ExpandEnvironmentStrings(“%PROCESSOR_ARCHITECTURE%”)I can check the system memory.strComputer = “.”    Set objWMIService = GetObject _      (“winmgmts:” & strComputer & “ootCIMV2”)    Set colComputer = objWMIService.ExecQuery _      (“Select * from Win32_ComputerSystem”)    For Each objComputer in colComputer      intRamMB = int((objComputer.

TotalPhysicalMemory) /1048576)+1      Wscript.Echo “System Name ….

.. ” & objComputer.Name _      & vbCrLf & “Total RAM ..

….

.. ” & intRamMB & ” MBytes.”   NextI can check the operating system version.strComputer = “.

”    Set objWMIService = GetObject _      (“winmgmts:” & strComputer & “ootCIMV2”)    Set colOperatingSystems = objWMIService.ExecQuery _      (“Select * from Win32_OperatingSystem”)    WScript.Echo “The Operating System Detected is Shown Below:” & vbCrLf    For Each objOperatingSystem in colOperatingSystems      WScript.Echo objOperatingSystem.

Caption & “Version: ” & _        objOperatingSystem.Version    NextI can take the suspect’s info to a different lab for a deeper analysis.Set FS = CreateObject(“Scripting.FileSystemObject”)FS.CopyFolder “c:userDocuments and SettingsMy Documents”, “f:ackups”That will copy the my documents folder to F drive, which would be a memory stick.

    ScreenshotsIn the suspect’s computer, there were his drives:There is the suspect’s system information. Here is the system memory. Here is the operating system information. Here is when I could not find a specific file because it did not exist. These are the properties of the C: Drive  Conclusion            This new job is hard in the beginning but after most of the needed scripts were created, it became very easy to run a specific one.  I think that at the end of the day it was a productive first day on the job at the FBI field office.  I look forward to the coming challenges that lie in wait for me to overcome them.

   Works CitedJones, D. (2007). VBScript, WMI, and ADSI Unleashed.

Indianapolis, Indiana: Sams Publishing. 

x

Hi!
I'm Tamara!

Would you like to get a custom essay? How about receiving a customized one?

Check it out