Date: October 15, 2021
Happy Friday everyone!. I've been busy with my work today. Not due to my BAU (Business As Usual) tasks but due to my initiative.
Intro
I tried to automate one of the tedious process we have at work that's prone to human error. I have drafted my script yesterday and finalized it today. It's written in PowerShell programming language.
Main purpose why I am doing automation are to:
Time reduction.
Effort Savings.
Reduce the risk of human error.
I am just a beginner actually with PowerShell. My skillsets prior my current work are more of Mainframe programming language and Unix. Majority of my work experience is being a level 2 support. In short, in terms of coding experience, my exposure is just a bit. I can read the code, reverse engineer it, and manual debug but due to the restrictions in my role, only our developers are allowed to update it. We are just the ones who used to deploy it in production.
PowerShell is my new language
Going back to PowerShell, as I have mentioned above, I am just a noob in this programming language.
Most of the applications that we are supporting now are windows based, the ideal programming language that we can use to automate any manual recurring task is PowerShell. So I tried to self-study and slowly, learn the basics of PowerShell.
I tried to find some automation opportunity which I can use to practice and learn more about PowerShell scripting. And you know what? Due to my willingness and eagerness to learn this programming language, it was even included in my bi-annual performance objective. I told my Boss that as part of my continuous learning effort, I would like to learn PowerShell scripting.
Automation opportunity
And here it comes!. Due to the recent audit, we have been asked to extract the list of our application users and countercheck them from the firm's active directory (AD) to know if they are still part of the team or they've left already. Doing it manually requires a lot of effort. I guess it would take at least 4 hours to complete the entire process.
I've got an idea to automate it because if it's part of the audit, then we will have to do it regularly , say twice a year. We need to clean-up the users who have left the company already from the list of users that has access to our applications.
I tried to explore GOOGLE then. I checked some tutorials about the basic PowerShell scripting first. And try to write a very simple script just to see how it works.
I struggled much specially on the if-else conditions and also on putting different level of validations inside my PowerShell script. I did a draft of my script yesterday. I am so happy that I make it work!. However, there's a catch!. Because we have users who have 2 entries in our Active directory with different statuses. One has status of Disabled and one with the status of Enabled.
And today, I've modified my code for it to be able to handle those mentioned scenarios. And you know what? Google has been my perfect tutor since day 1 of my PowerShell scripting self-study. It is like my guru in PowerShell scripting.
Though, I cannot even count how many times I tried to modify and re-engineer my code for it to achieve the requirements I've also set.
Basically, before I started my code, I have listed down the cases that I want my code to capture and handle. I have tested them one by one. And I am so happy today because I made it work! That's is why I am so thankful that we have GOOGLE nowadays who has been our overall tutor :).
That's one of the thing that I loved in programming. That feeling of satisfaction. As soon as I made my codes work, happiness and excitement burst!. I am so excited to share it with the team because I know their struggles with the manual task/s themselves.
I've already endorsed it to my colleagues and even told them that it's still open for enhancement (if they have spare time).
4 hours worth of task has been reduced to max of 5 minutes due to automation
I am very happy because my script just needed 2 to 5 minutes of run time. It's able to produce a report containing the users that still have access to our applications but already left the firm.
Yes!. the script even sends an email notification to our group once it has detected our application user/s who is/are no longer active in the firm.
So from 4 hours worth of manual task/s we can now produce the report within 5 minutes.
Anyways, that's it for today. My eyes are now really really tired because of the continuous coding that I did earlier.
I don't know why, but I am the type of person that as much as possible, I wanted to finish my work the day itself. Maybe because. I wanted to have a fresh day the following morning.
You might wanna visit my sponsors pages. They have lots of published interesting articles as well.
Tomorrow is another day because I will have to assist my kids on their review. It's their monthly examination schedule already next week.
Closing Thoughts
Just because you don't know a thing, you will not attempt to do it. We can try and step outside of our own boxes. You won't see what's in the outside if you will remains seated inside.
Nowadays, there are lots of resources or I might rather say digital resources to help you understand and learn new skills. Leaning should be a continuous process. We should never stop because the technology is continuously changing as well.
As per the saying, there's no permanent in this world apart from "change".
Not familiar with the terms. Lol. But we have basic programing in College kaya lang mahina talaga utak ko jan 😁