Join 78,963 users and earn money for participation

PowerShell : My new language

31 30 boost
Avatar for Khing14
Written by   189
1 month ago
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:

  1. Time reduction.

  2. Effort Savings.

  3. 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.

Image source

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

Image source

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.

Image source

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".

16
$ 5.88
$ 5.55 from @TheRandomRewarder
$ 0.05 from @Bloghound
$ 0.05 from @Codename_Chikakiku
+ 12
Avatar for Khing14
Written by   189
1 month ago
Enjoyed this article?  Earn Bitcoin Cash by sharing it! Explain
...and you will also help the author collect more tips.

Comments

Not familiar with the terms. Lol. But we have basic programing in College kaya lang mahina talaga utak ko jan 😁

$ 0.01
1 month ago

kahit ako sis. Pasang awa din nung college sa programming..hehehe...di ko kasi sineryoso talaga yun. Di ko akalain na mapapakinabangan pala yun pagdating ng araw. Pasalamat nalang talaga kay google

$ 0.00
1 month ago

I have not looked at the PowerShell that thoroughly. Tomorrow I'm going to look a bit about it. Lately I do everything in C ++

$ 0.01
1 month ago

I don't know how to code using c++ language yet

$ 0.00
1 month ago

Magaling, iba din tong c madame eh, pero tama ka madami talaga taung matututunan kung gugustohin talaga nating matuto..

$ 0.01
1 month ago

Ou sis.. Basta determinado ka magagawa mo

$ 0.00
1 month ago

Ay oo sis.. determinasyon din ang Kelangan jan at tyaga na din

$ 0.00
1 month ago

Pag wala ka nun wala talagang mangyayari.. Hehe

$ 0.00
1 month ago

Even the simplest typing and arranging my paragraph in the computer screen I messed up. Salute to you! You did a good job. To me Im Thankful to have my mobile phone so that I can at least type my article here;D

$ 0.01
1 month ago

Ahahaha.. Yeah.. Generations nowadays are so lucky to have google and high tech phones

$ 0.00
1 month ago

Wow! I didn't know you are a programmer 👏 female programmers are rare and I respect the ones that are in this field. You have carried the most important function of a programmer which is to solve problems. I also love programming but I have paused my learning for now because of academic work

$ 0.01
1 month ago

I think nowadays, we can all learn basic programmings.. There are lots of tutorials available in google which is good. You don't have to enroll in any expensive certification programs if you don't have budget

$ 0.00
1 month ago

Exactly ma'am. I did my HTML and CSS course online for free using Udemy, freecodecamp, w3schools, YouTube and a lot of other resources. A lot of things can be learnt online but I guess many people don't really know how to go about it, that's why they end up enrolling in expensive programs

$ 0.00
1 month ago

It's funny that most people still don't understand the power of the Internet, especially Google/YouTube on how it empowers people daily, to learn new skills.

$ 0.01
1 month ago

Right.. They are very useful if you will just use them in the right way..

Just imagine wha I mentioned, I am able to learn powershell scripting without the need to enroll and pay to different learningbentities just to learn it. Learning is free with google

$ 0.00
1 month ago

Your so knowledgeable ,this time it's so high-tech already , you have a very nice work ,goodluck to you

$ 0.01
1 month ago

Pasalamat sa google sis.. Hehe

$ 0.00
1 month ago

Wala na nga aKong time mag research research ay

$ 0.00
1 month ago

Hehe.. Oks lang yan sis

$ 0.00
1 month ago

Lodi ko talaga to hahaha. Sene ell maalam sa program huhu

$ 0.01
User's avatar Yen
1 month ago

Nag self study lang din ako sis.. Kasi nasama ko sya sa goal ko.. Ahahaha.. Eh sa december evaluation na namin.. Ahahaha

$ 0.00
1 month ago

I'm fascinated by people who can understand coding and stuff lol... I'm like a monkey in those things

$ 0.01
1 month ago

We're lucky nowadays because almost everything we need can be foundnkn google...

$ 0.00
1 month ago

Is it like Javascript sis?

$ 0.01
1 month ago

Ibang language pa po yung java sis.. Hindi ako marunong mag java.. Hehe

$ 0.00
1 month ago

woot woot for automation. I never thought of trying PowerShell though..

$ 0.01
1 month ago

Yeah my first time to use it as well..

$ 0.00
1 month ago

Nosebleed ako jan, sis!

$ 0.01
1 month ago

Qhahaha.. Ang gusto ko lang sabihin dyan sis try and try kapag may ginusto

$ 0.00
1 month ago

Correct sis sauna lang mahirap at kung mag fail man atleast you try wala kang pagsisihan sa huli .

$ 0.01
1 month ago

Ou sis.. Hehehe.. Self study ako ng programming

$ 0.00
1 month ago