I do a lot of work setting up systems. That means imaging a lot of similar model computers and operating systems. In most instances everything is set up in the disk image. But the times when there are OS and security updates, new software installations, configuration changes and last minute changes it can get a little time consuming.
After going into the command prompt (CMD) in Windows typing a few lines of code to pull information, navigating through the OS to turn on or disable services, features or changing privileges several times it gets tiring. In an effort to be more efficient (making my job easier) I started looking up different scripts to do different tasks.
Examples:
* net user administrator /active:yes To run as administrator
* netsh http add urlacl url=http://+:8083/ user="Everyone"
I believe this allows everyone access to port 8083.
* wmic csproduct get name To get the model
* wmic bios get serialnumber To get the serial number
* The following code is disabling Windows services.
sc stop "SysMain"
sc config "SysMain" start=disabled
sc stop "WSearch"
sc config "WSearch" start=disabled
As soon one of these script experiments prove useful it gets incorporated into our procedure. This is great because it can save time just typing a few lines of code instead of doing it the old fashion way. This too can get tedious. That is why I moved on to creating batch files. All of the scripts shown above and others not mentioned can be run in succession by using a text editor and saving the filename with a .bat at the end. This method has proven useful for on the fly experimentation and implementation. A similar approach can be used in bash if you prefer using a Linux or mac environment. Have fun.
댓글