# Does my computer use LAN or WLAN

**URL:** <https://forums.powershell.org/t/does-my-computer-use-lan-or-wlan/26304>\
**Category:** PowerShell Help\
**Created:** [January 12, 2026, 11:57am UTC](https://forums.powershell.org/t/does-my-computer-use-lan-or-wlan/26304 "2026-01-12T11:57:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SG08234](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@SG08234](https://forums.powershell.org/u/SG08234)\
**Post date:** [January 12, 2026, 11:57am UTC](https://forums.powershell.org/t/does-my-computer-use-lan-or-wlan/26304/1 "2026-01-12T11:57:07Z")

</div>

I need a script which gives me the information: Does my computer use LAN or WLAN?

Unfortunately “Get-NetAdapter” shows both connections with Status “Up”. How can I extract the currently **used** connection?

Thanks - Michael

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [January 12, 2026, 3:19pm UTC](https://forums.powershell.org/t/does-my-computer-use-lan-or-wlan/26304/2 "2026-01-12T15:19:30Z")

</div>

Depending on your system settings it possible that both connections are activ and used … 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![SG08234](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@SG08234](https://forums.powershell.org/u/SG08234)\
**Post date:** [January 12, 2026, 3:37pm UTC](https://forums.powershell.org/t/does-my-computer-use-lan-or-wlan/26304/3 "2026-01-12T15:37:23Z")

</div>

Apparently I can evaluatethe active connection by:

```auto
Test-NetConnection -ComputerName <router-ip>

```

Is this correct? Thanks - Michael

---

<div class="post-metadata">

**Author:** ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)\
**Post date:** [January 12, 2026, 4:58pm UTC](https://forums.powershell.org/t/does-my-computer-use-lan-or-wlan/26304/4 "2026-01-12T16:58:02Z")

</div>

I think it would be helpful if you clarify what “active” means to you. If you want to know what your primary network adapter is, I have a function for that.

> <https://github.com/krzydoug/Tools/blob/master/Get-PrimaryNetAdapter.ps1>

---

<div class="post-metadata">

**Author:** ![SG08234](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@SG08234](https://forums.powershell.org/u/SG08234)\
**Post date:** [January 12, 2026, 7:01pm UTC](https://forums.powershell.org/t/does-my-computer-use-lan-or-wlan/26304/5 "2026-01-12T19:01:08Z")

</div>

Thanks!  
In my use case I need to know which network adapter during a procedural backup job from computer to NAS (Drive Snapshot) is used because

- I suspect WLAN not working reliable und thus causing errors
- but LAN working reliable

Michael

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [January 12, 2026, 10:29pm UTC](https://forums.powershell.org/t/does-my-computer-use-lan-or-wlan/26304/6 "2026-01-12T22:29:52Z")

</div>

> [@SG08234](#):
>
> In my use case I need to know which network adapter during a procedural backup job from computer to NAS (Drive Snapshot) is used because
> 
> - I suspect WLAN not working reliable und thus causing errors
> - but LAN working reliable

Why don’t you make sure that this backup job only runs on the desired network connection? If it runs as scheduled task you can even set it up in the scheduled task that the task only runs when a specific network connection is available. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![SG08234](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@SG08234](https://forums.powershell.org/u/SG08234)\
**Post date:** [January 13, 2026, 1:32am UTC](https://forums.powershell.org/t/does-my-computer-use-lan-or-wlan/26304/7 "2026-01-13T01:32:23Z")

</div>

Olaf: Good proposasal but: The jobs runs as a scheduled task for appr. 50 different users with 50 different desired networks. I want to save the effort to maintain the information about the desired network. And: I am kean to know if my assumption “WLAN does not work reliable” is correct.  
Michael

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [February 12, 2026, 1:32am UTC](https://forums.powershell.org/t/does-my-computer-use-lan-or-wlan/26304/8 "2026-02-12T01:32:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
