Course Project

 

 

 

 

 

Course Project

By Michael Tsui

 

 

 

 

 

COMP230

Professor Joe Njoloma

 

 

 

 

Table of Contents

 

Introduction ………………………………………………………………………………………3

Description of program (script) …………………………………………………………………..3

Source Code with detailed comments ……………………………………………………………4

Screenshots of the output …………………………………………………………………………5

Conclusion ……………………………………………………………………………………….6

Works Cited ………………………………………………………………………………………7

 

 

 

Introduction

My 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 Code

The 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.Drives

for each objDrive in coldDrives

wscript.echo “Drive: ” & objDrive.driveLetter

wscript.echo “Size: ” & objDrive.totalSize/1024*2 & “MB”

next

This 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.drivetype

wscript.echo “FreeSpace: ” & objDrive.FreeSpace/1024*2 & “MB”

wscript.echo “Filesystem: ” & objDrive.Filesystem

wscript.echo “isReady: ” & objDrive.isReady

wscript.echo “Path: ” & objDrive.Path

wscript.echo “RootFolder: ” & objDrive.Rootfolder

wscript.echo “SerialNumber: ” & objDrive.SerialNumber

wscript.echo “ShareName: ” & objDrive.ShareName

wscript.echo “VolumeName: ” & objDrive.VolumeName

Now that I see the properties of the drive I can copy the drive’s content.

const OverWriteFiles = True

Set 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”) then

set objFile = objFSO.GetFile(“c:windowssystem32scrrun.dll”)

wscript.echo “Data Created: ” & objFile.DateCreated

wscript.echo “Date Modified: ” & objFile.DataLastModified

wscript.echo “Drive: ” & objFile.Drive

wscript.echo “Name: ” & objFile.Name

wscript.echo “Path: ” & objFile.Path

wscript.echo “Size: ” & objFile.Size

wscript.echo “Type: ” & objFile.Type

else

wscript.echo “file can’t be found”

end if

I 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.”

   Next

I 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

    Next

I 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. 

 

 

Screenshots

In 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 Cited

Jones, 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