Cleanup disabled users from AD Group/s

Cleanup disabled accounts from groups is one of the most boring job, and also take lots of time. Manually it’s almost impossible to maintain. Recently I had a request to perform such task for many groups, so, I wrote a script to do it automatically on behalf of me. I am now sharing this script, hoping this might help you as well.


This script will do following task automatically.

  • Get the members of a group.
  • Identify only users.
  • Identify disabled users.
  • Check every disabled users group memberships.
  • Remove the disabled users from that group.
  • Generate a report with status (success / failure).
  • Keep the report on your desktop.

New Feature : EC2 Instance Console Screenshot for Boot Troubleshooting

Finally a great feature add to AWS EC2 instances (HVM virtualization only), which was requested by almost everyone. Now we can take a console screenshot of any EC2 Instances. This is now available publicly. Earlier we had to log a case with AWS Support to get the AWS Console screenshot. This is a similar feature like Boot Diagnostics for Azure Virtual Machines v2.

This new feature will be very much helpful for every AWS Administrators, especially for those who providing support to Windows instances.


In past I had few experience of EC2 Instance getting stuck during boot and we had to request for the console screenshot from AWS Support for troubleshooting. This process was time lengthy during crisis situation. I guess this feature will be welcomed by everyone.
Continue reading

Multi-Threading Super-Fast Disk Utilization Report using Background Jobs in PowerShell

Automate task using script is always helpful, it reduced human error and efforts, but sometimes it still takes a lots of time to execute same command on multiple remote servers one by one. For example, my disk utilization script, it works perfectly fine, but taking lots of time to generate report for thousands of servers. To get the result faster I started looking for using Background Jobs, and the result was really promising.


Earlier approx. for 500 servers, it took almost 10 to 15 seconds each and total more than 2 hours, and after using PS Background Jobs, it takes less than 5 minute to generate the report.
Continue reading