- Dev Blogs
- Scripting Blog [archived]
The “Hey, Scripting Guys!” blog has been retired. There are many useful posts in this blog, so we keep the blog here for historical reference. However, some information might be very outdated and many of the links might not work anymore.
New PowerShell content is being posted to the PowerShell Community blog where members of the community can create posts by submitting content in the GitHub repository.
Scripting Blog [archived]
Formerly known as the "Hey, Scripting Guy!" blog
Latest posts

Why am I Getting an Error when Trying to Determine an IP Address?

Hey, Scripting Guy! I’m trying to determine the IP address on a computer, but I keep getting a Type Mismatch error. Do you know why? -- AQ, Jacksonville, FL Hey, AQ. As a matter of fact, we do know why you’re getting a Type Mismatch error, and it’s a common problem when working with the WMI class Win32_NetworkAdapterConfiguration. The line in your script that’s causing the problem most likely looks something like this: So what’s the problem? Well, the IPAddress property is actually stored as an array; that’s because it’s possible for multiple IP addresses to be assigned to a single network adapter. You’re treati...