On code optimisation

As organisations move towards more automation, those that use Windows-based environments encourage learning PowerShell. Our organisation is one of these. This morning, we received a challenge: Before you leave for the holidays, the Elves in Accounting just need you to fix your expense report (your puzzle input); apparently, something isn’t quite adding up. Specifically, they need you to find the two entries that sum to 2020 and then multiply those two numbers together.

Moving to a new domain

I wanted to move the site from the old domain to a new one. The idea was to make this site a little more personal, and less snobbish. I picked the .io TLD. I liked it. The idea was also that I plan to make it not merely about PowerShell, but about infrastructure automation in general. The general plan I had in mind was: Buy ramiyer.io. Log into my DNS console and add entries to GitHub Pages IP addresses.

Bulk deletion of an email from mailboxes

I have been an Exchange administrator. (And I have fond memories of those days.) Exchange is often an overlooked, underappreciated aspect of EnterpriseĀ IT administration. Of course, this is 2020, and we are steadily moving away from emails, replacing it with the likes of Teams, Slack, Wire and what not. I had read an article a long time ago (which I cannot find anymore) that pointed out the inherent flaws in emails; emails were never meant to be secure.

Updating a distribution list with error handling

This morning I woke up to a query whether we could do a bulk addition of users (with email addresses) to a distribution list. The team got a list of users to add and the name of the distribution group as part of the request. The administrators would then copy-paste the email column to a new CSV file, place the file on the desktop and run a one-liner. Import-Csv "C:\Users\USER88398\Desktop\book1.csv" | ForEach-Object { Add-DistributionGroupMember "DL-DistributionGroup070818" -Member $_.

How to run a PowerShell script

Often, administrators face situations where they run scripts written by someone else. After all, that is what a community is all about. When the admin is new to PowerShell, and when he does not understand how to run a PowerShell script, he feels a little lost. And this is normal. I often meet administrators who are unsure how to run a script. How to run the function within the script Calling functions outside of the script Other methods of loading functions Calling a function without loading it into the session Loading the function into the session Summary Now, sometimes, the approach I used to take was to write the script in such a way that the moment someone calls it either from the console or using one of the integrated environments, the script would run and complete its task.