Verify all AD groups added to a domain user

Most important task when you join a new organization or when you start working for a new client is to gain access to all required AD groups. I had to switch several times and this was a pain point. My manager would share a list of AD groups and ask me to check if my account is added to all those groups across all domains. Hence being lazy, I had to make use of below simple script to fetch and compare lists quickly at each domain.

Store the script in a file and name it for example “groups.ps1”. Copy-paste all AD group names required for your job role into a separate text file named groups.txt in the same folder. Open a powershell prompt, Navigate into the directory and execute below command.

You could further customize the script based on your requirement.

Auto restore multiple databases in One shot using powershell

Below script helps restore several databases on to a SQL Server instance in one go. We just have to place all the .bak files in a folder and execute the script. before running the script, its required to import SQLPS in the powershell prompt as below.

Save below script as restore_all.ps1

Execute the script like in below example.