-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGet-RemoteWLANInfo.psm1
30 lines (28 loc) · 1.16 KB
/
Get-RemoteWLANInfo.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Function Get-RemoteWLANInfo {
param(
[string] $ComputerName
)
begin
{
echo "Retrieving WLAN info from $computer..."
}
process
{
$results1 = Get-WmiObject -computername $ComputerName win32_networkadapter | Where-Object {($_.NetConnectionID -like '*Wireless*') -or ($_.NetConnectionID -like '*Wi-Fi*')} | select Name, Speed
$results2 = Get-WmiObject -computername $ComputerName win32_networkadapterconfiguration | Where-Object {$_.Description -like $results1.Name} | Select Description, DHCPEnabled, DHCPLeaseObtained, DHCPServer, DNSHostName, IPAddress, MACAddress
$results2.DHCPLeaseObtained = $results2.DHCPLeaseObtained.Substring(4,2) + "/" + `
$results2.DHCPLeaseObtained.Substring(6,2) + "/" + `
$results2.DHCPLeaseObtained.Substring(0,4) + " " + `
$results2.DHCPLeaseObtained.Substring(8,2) + ":" + `
$results2.DHCPLeaseObtained.Substring(10,2) + ":" + `
$results2.DHCPLeaseObtained.Substring(12,2)
$results1
$results2
}
end
{
echo ""
echo "Finished retrieving WLAN info."
}
}