Archive for the ‘Power Shell’ Category
Here are a couple of very useful scriptlets if you ever need to enumerate or count the quantity of users in an AD group.
Today I needed to write a bit of code that would enable a script to run for 23 hours and 55 minutes before ending itself. So I dug in to PowerShell and again it came up with a fantastic solution for looping until a certain time.
In: Power Shell · Tagged with: loop, PowerShell
The following PowerShell one liners give you hostname to IP or vice versa.
In: Power Shell · Tagged with: dns, hostname, ip address, nslookup, PowerShell
Today I needed to validate an IP address after a user types it in to a script. I don’t want to ping or check connectivity, I just want to validate that the format looks like a valid IP address. I looked at various regex expressions which were getting complicated. Then I stumbled upon this little nugget:
In: Power Shell · Tagged with: .NET, ip address, validate
Today I needed to copy about 300 users from one AD group to another and there was no way I was going to do that manually. So I started looking in to what PowerShell can do adn here is what I found: