Scripting Blog

A place to learn about PowerShell and share stories of automation

Hey, Scripting Guy! How Do I Find Information About the Network Adapter Cards on My Computer?

Hey, Scripting Guy! When I use WMI to query for network cards on my laptop, it comes back with 32 network cards. 32! I am not lying. My laptop does not even have 32 slots, so how does it have 32 network cards in it? How can I find information about the "real" network cards on my laptop? I figure I should only have two: the wired NIC and ...

How Can I Change the First Two Octets of an IP Address?

Hey, Scripting Guy! How can I change the first 16 bits on an IP address? I want to keep the last 16 bits exactly the same.-- LD Hey, LD. Before we answer your question we should note that we are well aware that “suggestive” photos of an American Idol contestant have allegedly been uncovered on the Internet. Needless to say, we know many...

How Can I Modify the Output of the Ping Command?

Hey, Scripting Guy! How can I place the current date and time at the beginning of each line of Ping.exe output?-- AL Hey, AL. We have to admit, we were a little shocked by your question. Change the output of the Ping command? Really, AL. Would you ask us to rewrite Romeo and Juliet, giving it a more happy and upbeat ending? Would you ask us...

How Can I Change the IP Address Assigned to a Computer?

Hey, Scripting Guy! How can I change the IP address assigned to a computer?-- RW Hey, RW. To tell you the truth, this is a very difficult question for the Scripting Guys to answer. Not because this is a hard script to write; as you’ll see in a minute, it’s actually pretty easy. No, this is hard for the Scripting Guys because it involves...

How Can I Prevent a Computer from Using the LMHosts File?

Hey, Scripting Guy! How can I prevent a computer from using the LMHosts file?-- MJ Hey, MJ. You know, this was an interesting one, at least for the Scripting Guys. Not because the script was hard to write; that was actually pretty easy. What was hard - at least for us - was to find the LMHosts setting in the Windows GUI; that’s something ...