![]() $Writer = New-Object System.IO. In the above example, Get-WmiObject cmdlet gets printers list installed on specified computername (local machine or remote machine) and get printer ip address. $Socket = New-Object ( $RemoteHost, $Port) On having a txt doc that lists the IP’s of your switches ![]() $switches = Get-Content \\\share$\scripts\switches.txt $ErrorActionPreference = 'silentlycontinue' Length 0", "show mac address-table address $macaddy ", "exit")Ĭommands do what you expect first, then script Get-NetworkInfo CmdLet is part of Common module and if you have downloaded the source code it can be found in the folder \ Documents\WindowsPowerShell\Modules\03common. It will also copy the MAC address to the clipboard for you. ![]() You can also look up the MAC of the computer you're currently at by using it's hostname or 'localhost'. #assumptions: you have the right commands to locate the MAC on a switch, example below for cisco, you have a txt doc that lists the IPs/Hostnames of your switches, the MAC is actually live and connected in the environment.# POWERSHELL MAC ADDRESS REMOTE COMPUTER CODE. This script will lookup the MAC address of a machine on your local network as long as you know the hostname. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |