Last week, I showed you how I looked up a single user in Active Directory, using the Get-ADUser
cmdlet. I noted that I had an issue with finding some users due to spelling errors. This wasn’t a problem when I was doing them individually, but I soon found myself needing to do the same for more than a hundred users.
Tag: foreach
-
PowerShell: Find many users using their name
-
PowerShell: Finding host name from IP address
In tech support, resolving IP addresses to host names can be something you do on a relatively frequent basis. While I’ve always used the CLI
(more…)ping
command with the-a
option, I have also been working towards higher proficiency in PowerShell. Frankly, for a single IP address, I prefer sticking with CLI. When working with a number of addresses, however, it gets a lot more interesting. -
Powershell: A script to find all members of several groups refined
One of the scripts that I use most often is the one I wrote about back in September of 2019. Usually, I only run it for up to ten or so groups, so it’s not a big problem to simply swap out the group name, rince and repeat. Recently, however, I needed to run it for more than five hundred groups. The sheer amount of data makes that a very different proposition.
(more…) -
Powershell: Add user to multiple groups
A while back, I had a user that had to be added to a large number (150+) of active directory groups. Rather than doing so manually, I spent a little time looking up how to automate it, and created a script to help me do it. Here’s how I constructed it:
(more…)