Jump to content

I would like to automate part of my job

bronsonj

Alright guys I would like to do what the title says and automate part of my job.

What I have been doing recently is after a system gets imaged it goes to a small team I work with. What we do from there is rename the system, install our vpn, add bit locker and add it to the domain. I guess what I'm wondering is can I automate this(reasonably easy?)?

I have access to notepad++ and made a .bat to do a ipconfig release and renew as well as flush DNS. (We had random networking issues and this fixed it)

Please forgive bad punctuation I'm on mobile.

Link to comment
Share on other sites

Link to post
Share on other sites

If you can install the apps and make changes with a few commands and not have to interact with the screen (selecting options, etc) then it should be pretty straight forward. 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Basically what Federico said. 

 

You can install write a script that calls the execution of the installers basically. 

 

Thats how id do it but idk how to. 

I think “powershell” is the new “bat” or “batch” file. It should have more things you can do easier. 

You should be able to write those in notepad or notepad plus plus. 

 

@Mira Yurizaki should know more about automation with powershell iirc. 

Link to comment
Share on other sites

Link to post
Share on other sites

On 6/19/2020 at 12:36 PM, fpo said:

I think “powershell” is the new “bat” or “batch” file. It should have more things you can do easier.

Powershell is more powerful, but easier is a weighted term.  If it exists in bat, it actually I find is easier with bat (could be the oldschool part of me, but because bat is so simple I find it quicker to write certain tasks with it)...with that said, I agree powershell.

 

@bronsonj I've actually done similar things in the past (with things such as installs that aren't friendly in terms of mass deployment) and generally creating scripts to do what needs to be done.  Keep in mind though, it is all about how much time  you want to invest in it compared to what you will get out of it.  Things such as renaming, joining, and general Windows stuff is really easy to automate (and can be recycled later for other purposes).  Calling an install (which might only be installed on a few dozen PC's might not be worth the effort, unless you had free time or will repurpose it to install other programs).

 

I would ask though, how good is your programming skills (even if it is basic, you could do very powerful things).

 

Powershell if the way to go, and there are plenty of examples or documentation for tasks that you want to do.

 

Renaming - https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/rename-computer?view=powershell-7

Domain joining - https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/add-computer?view=powershell-5.1

Bitlocker stuff - https://docs.microsoft.com/en-us/powershell/module/bitlocker/enable-bitlocker?view=win10-ps

https://docs.microsoft.com/en-us/powershell/module/bitlocker/add-bitlockerkeyprotector?view=win10-ps

VPN (If it's using the built in Windows 10 one, but needs the settings) - https://docs.microsoft.com/en-us/powershell/module/vpnclient/add-vpnconnection?view=win10-ps

 

If you needed particular help with something, or get stuck can always just post where you get stuck and I am sure people will help as well.

 

For program installs (lets say you use an external VPN program that you are installing), check if it supports installing without user interaction (there are quite a few that allow this, if you are unsure and can't find your answer can always just ask here with the name of the program).  The other, harder approach is using something like autoit...if you haven't used it before, really would consider learning it. (there is autohotkey, but I prefer Auto IT)

 

AutoIT Installing programs (for ones that don't support automation) - This is how I do it, and I only do it this way because I find it very quick to program once I have my template.

Pre-steps

Run the setup, try navigating all menus with the keyboard (and monitor each key press)..e.g. Enter, tab, tab, enter, alt-e, [serial #], etc.

Steps

Auto-IT launches setup, waits x seconds (to account for it launching and buffer time in case it takes longer than normal).

Have Auto-IT press each key that you wanted (along with wait timing)

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

Just some random tidbits of info:

Chocolatey is a convenient tool to install many programs through cli

Microsoft recently announced their own package manager, although admittedly it's very new and I haven't tested it at all 

Ansible playbooks can be a nice way to only install one program manually and have most other stuff taken care of, if you want a powerful if potentially overkill solution

Main Rig: R9 5950X @ PBO, RTX 3090, 64 GB DDR4 3666, InWin 101, Full Hardline Watercooling

Server: R7 1700X @ 4.0 GHz, GTX 1080 Ti, 32GB DDR4 3000, Cooler Master NR200P, Full Soft Watercooling

LAN Rig: R5 3600X @ PBO, RTX 2070, 32 GB DDR4 3200, Dan Case A4-SFV V4, 120mm AIO for the CPU

HTPC: i7-7700K @ 4.6 GHz, GTX 1050 Ti, 16 GB DDR4 3200, AliExpress K39, IS-47K Cooler

Router: R3 2200G @ stock, 4GB DDR4 2400, what are cases, stock cooler
 

I don't have a problem...

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×