Saturday, May 4, 2013

Script requests and the ultimate computer object

I hope everyone is finding this blog helpful.  I recently (finally) finished my BS in Information Technology and have been brushing up my resume.  Time to hit the job market and see if there are any bites! If you have any ideas for a new subroutine or function and would like me to cover it on this blog, let me know.  I would be glad to write the code and explain it here.

Also, I have an on-going piece of code that I update from time to time that may be useful for some of you.  It's a class object for a computer that will let you perform many tasks such as getting and setting all kinds of info and preforming actions like rebooting.  The class object is only about 70% complete at the moment but works like this:

Set objComputer = New Computer

objComputer.Name = "myComputerName"

Wscript.Echo objComputer.FreeRAM
Wscript.Echo objComputer.TotalRAM
Wscript.Echo objComputer.SystemDrive
Wscript.Echo objComputer.SystemDirectory
Wscript.Echo objComputer.WindowsDirectory
Wscript.Echo objComputer.Role
Wscript.Echo objComputer.LocalDate
Wscript.Echo objComputer.LocalTime
Wscript.Echo objComputer.IP
Wscript.Echo objComputer.DN
Wscript.Echo objComputer.DC
Wscript.Echo objComputer.CurrentUser
Wscript.Echo objComputer.SerialNumber
etc, etc, etc....

And there are functions too.  Like getting the current users, shutdown, restart, log off, enable DHCP, auto-assign DNS, assign specific DNS,  set WINS, etc.

The code as a mix of local and remote capability which means that once you set the Name property, it can use that to pull or set information for remote machines.  However, not all properties and methods use this.  I need to document that better and add more feedback to notify the coder.  By default, when you declare the new object, it automatically determines the local PC name and sets the Name property.  So if you are using it local, you don't have to set it.

In all, this class is very modular and robust.  It's just not quite finished.  I'm always finding new stuff to add and there is soo much more to add.  If any of you are interested in this, let me know.  I'd be glad to send you what I have to help you code faster!


No comments: