Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: all mac in LAN  (Read 3193 times)

0 Members and 1 Guest are viewing this topic.

zodehala

    Topic Starter


    Rookie
    all mac in LAN
    « on: February 03, 2012, 09:19:18 AM »
    we have 2 workgroup in win network (workgroup and callcenter)

    first of all i am listing pc using net view /domain:workgroup and  net view /domain:callcenter

    and ping it to find ip and MAC

    callcenter pc name is like

    \\Agent-1
    \\Agent-2
    ..
    ..
    \\Agent-100

    i can find a pc MAC  usign this command nbtstat -a Agent-1

    1- how can i find all pc mac usign just one command ?
    2- i can print it into text file like command > c:\conf.txt. how can i do it for all pc at one time

    Raven19528



      Hopeful
    • Thanked: 30
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 7
      Re: all mac in LAN
      « Reply #1 on: February 03, 2012, 10:36:43 AM »
      Try this short piece of code:
      Code: [Select]
      @echo off
      setlocal enabledelayedexpansion

      for /f "delims=" %%A in ('net view /domain:workgroup') do (
        set comp=%%A
        set comp=!comp:~2!
        nbtstat -a !comp! >>MAC.txt
      )

      If you are wanting to have a specific output that is maybe only one or two lines per entry, it will require some additional work, so let us know if that is what you are wanting.
      « Last Edit: February 03, 2012, 10:47:41 AM by Raven19528 »
      "All things that are
      Are with more spirit chased than enjoy'd" -Shakespeare

      zodehala

        Topic Starter


        Rookie
        Re: all mac in LAN
        « Reply #2 on: February 04, 2012, 02:47:03 AM »
        first of all

        fetching mac all pc in workgroup in one go

        Raven19528



          Hopeful
        • Thanked: 30
          • Computer: Specs
          • Experience: Experienced
          • OS: Windows 7
          Re: all mac in LAN
          « Reply #3 on: February 06, 2012, 02:29:43 PM »
          first of all

          fetching mac all pc in workgroup in one go
          Ummm... What?
          "All things that are
          Are with more spirit chased than enjoy'd" -Shakespeare