Automating processes can make your life so much easier.
As an IT staff member you’ll most likely find yourself repeating the same procedures over and over again on different machines. Everyone needs to have certain drives mapped, printers installed, security settings setup, power plans installed, computers added to the Domain, applications installed, (Backups, Processes, and Tasks Scheduled), etc. You can automate these procedures and save yourself a lot of time in the process.
Also, by automating these tasks, you decrease the possibility of forgetting something and it makes your checklist that much easier to manage. By adding the pause between every set of functions, you can ensure that every function completed without errors.
Creating a scripts specific to your business is easy.
Instructions:
- Create a text file
- copy the code below into it
- Substitute your Servers, Printers, Domain Control, etc, info the script
- Copy as many scripts as you need into the file to complete the computer setup.
- Save file as a “.bat” file
- Run the file (Run as Administrator) on the computer you are setting up.
Below is a list of scripts for common task a Support Tech will need.
Adding Printers:
Adding a printer is fairly straightforward. It’s a simple rundll32 command.
- “printui.dll” is the file used to configure a printer
- “PrintUIEntry”is case sensitive. It initiates the installation of the printer
- The “/in” tells the installer that this is a network printer.
- The “/n” gives the function the printer’s name
Add Printer Code:
rundll32 printui.dll PrintUIEntry /in /n "\\YourPrintServer\NameOfNetworkedPrinter"
pause
Mapping Drives:
Mapping Drives is super easy . But you need to make sure that any drives currently mapped to the drive letters you are going to be using is removed before mapping the new drives. So I included the script to remove already mapped drives first.
NOTE: This is script is meant for Domain Computers. If they are not on a Domain, you will need to add the host computer’s (server’s) Username and Password to the script.
Mapping Domain Drives:
net use J: /delete
net use I: /delete
net use O: /delete
net use J: \\YourFileServer\NameOfSharedFolder /persistent:yes
net use I: \\YourFileServer\NameOfSharedFolder /persistent:yes
net use O: \\YourFileServer\NameOfSharedFolder /persistent:yes
net use S: \\YourFileServer\NameOfSharedFolder /persistent:yes
pause
Mapping Network Drives
Script with Username and Password:
net use J: /delete
net use I: /delete
net use O: /delete
net use J: \\YourFileServer\NameOfSharedFolder /USER:domain\username password /persistent:yes
net use I: \\YourFileServer\NameOfSharedFolder /USER:domain\username password /persistent:yes
net use O: \\YourFileServer\NameOfSharedFolder /USER:domain\username password /persistent:yes
pause
Adding a Computer to the Domain:
Every computer on your network should be on a Domain Controller. So here is a quick script to automate it.
(Note: You must be logged in to the computer with Administrator Privileges to add a computer to a Domain)
Adding PC to Domain:
add-computer –domainname "YourDomainName" -restarta
Backup Your Browser with one click. Click here to get the Script.