dewauto Posted February 20, 2023 Posted February 20, 2023 (edited) I want to get the name of the connected NetConnectionID of the system's NetConnectionID. thank you Edited February 20, 2023 by gooddew
rudi Posted February 20, 2023 Posted February 20, 2023 Hello, wellcome to the forum. Pls have a look at these to URLs as a start: https://devblogs.microsoft.com/scripting/using-powershell-to-find-connected-network-adapters/#using-wmi Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
Solution zid Posted February 20, 2023 Solution Posted February 20, 2023 Try this: Local $objWMIService = ObjGet("winmgmts:\\localhost\root\cimv2") Local $aItems = $objWMIService.ExecQuery _ ("SELECT NetConnectionID FROM Win32_NetworkAdapter WHERE NetConnectionStatus='2' ", "WQL") For $objItem In $aItems ConsoleWrite($objItem.NetConnectionID & @CRLF) Next dewauto and ioa747 1 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now