Shout Out Wednesday

As I have been doing my training and prep for getting my Azure Certifications I have tapped a lot of sources. Today I want to shout out one of those sources. I’m always looking for interesting classes, videos and training. A big thing in my learning process is I like to go into detail , while I also like an good presentation that is personal and easy to listen to.

An example of someone who does both well and is so easy on the listen is John Savill. He has the blog, a YouTube Channel, Twitter, PluralSight (one of my favorite sites), and the list goes on and on. One of the big things I like about John’s work is that while he does Azure, he does other things, and keeps it light. I used a lot of different sources for my AZ-900 prep that were all very in depth and gave me the breadth of knowledge to pass the test, but John’s one hour cram session was the topper that gave me the clear head to get it done. Please stop by and check out his library and sites. You won’t be disappointed.

PowerShell and AD Groups over 5000 Members

I work in a Hybrid Environment which means that I deal in both Azure AD and on-premises Active Directory. A major hassle that I have never gotten a real good answer that makes any sense is the restriction on groups having more than 5,000 members. I always see “For Windows 2000 Active Directory environments” in the answer. Aren’t we in 2020 with 2019 DC’s? Why is this still an issue with the AD database? We have many groups with more than 5,000 members, it’s a fact of life in a larger AD environment unless you want groups named Finance1, Finance2, Finance3, etc. for a group that has 10 to 15k members.

This creates a major issue when you are trying to pull the members of a group for a task with PowerShell. It’s possible, but the code is different and there are way too many different ways to do it. I’ve found one method that I feel does a real good job, and is not too complicated. It’s a work around in my mind, but here it is for anyone that needs it for AD on-premises.

<# This script gets members in a group above 5,000 members. Depending on the domain you need to change the -Server Parameter to a DC in the domain the users are in #>
$group = ‘My Group Name’
$server = “My ADDS Domain Controller in appropriate domain”
<# this is a one liner that spacing word wrap’s #>
(Get-ADGroup $group -properties members -Server $server).members | Get-ADUser -properties SamAccountName -Server $server | Select-Object SamAccountName | Export-Csv C:\Temp\MyFileName.csv -NoTypeInformation -Append

This basically gets the AD group I specify looking at the property members and dot sources that member. It passes that information to get the AD User with the property SamAccountName also on the same domain controller. I pass that through to Select just the SamAccountName so I can then Export it to a CSV in my “temp” folder. Of course you can specify whatever you want the output to be, DisplayName, etc. In my case I’m just looking for the SamAccountName.

There are many different ways to do this. Please take this as just a helper, something to try, modify, make better. Make it into a function so that it can be placed into a module, whatever you like. It suits me for what I need, but if you really wanted to you could make the $group and $server into a Read-Host to type the information in has you run the script in it’s simplest form. This is my way of passing it along like a lot of people have done for me. “Be the Master”

Taking Care of Yourself

During the pandemic we have all had to sacrifice. One of the big things that I’ve seen as a diabetic at 60 years old is that you can’t just sit in the house. I have new aches and pains, my mind runs wild with what are these pains. Plus my blood sugar has not been good.

Here is what I’ve decided to do because I didn’t like that feeling.

  • Set times to get up and walk. It doesn’t matter where, just 20 minutes every few hours.
  • Take another break every hour for 5 minutes to stretch, do 10 push-ups, jump rope for a minute, or something to get the blood flowing.
  • Three meals a day mostly protein, about 40 grams of carbs. Don’t eat after 7pm. Below is an example, but you get the idea.
    • Breakfast – eggs, sausage, wheat toast
    • Lunch – tuna creations or water canned tuna, salad and a small carb
    • Dinner – chicken, fish or beef with a vegetable, some Greek yogurt for carbs
    • Snacks of nuts, seeds, baby carrots, celery

You also need some other type of exercise. I prefer after 7pm so that I get all the tension out from the day. Be it a treadmill, lifting weights, Karate, jogging, bike riding, outside or stationary. Just do something for 30 to 45 minutes. It also leads to a cool down, relaxing shower and a bottle of water. I also take this time after getting settled in after the shower to read, or listen to one of my podcasts I’m subscribed to.

I hope everyone is staying safe, and remember it’s about your health and everyone else’s.