Getting MAC addresses

BatchPatch Forums Home Forums BatchPatch Support Forum Getting MAC addresses

  • This topic has 3 replies, 2 voices, and was last updated 4 years ago by doug.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12593
    laurie
    Participant

    Hi
    Over time we have replaced most of our desktops with laptops. I found it time consuming to collect laptop IP addresses since I don’t know when laptops will be on the network. If I run a Get MAC address operation at say 11am, when most laptop will be on the network, existing MAC addresses of laptops not on the network (offsite at the time) will have their MAC addresses removed

    It would be great if I could run a scheduled tasked that would collect /update the laptop .bps file through out the day.
    If creating a task to automatically update MAC addresses is a pain could a new function be created (Get-New-MAC-addresses) that leaves existing MAC addresses and only populates if blank.

    #12594
    doug
    Moderator

    First I would note that the MAC gets logged in the ‘All Messages’ column, so you’ll have the entire history there. I would think that alone should be sufficient because even if the MAC column/field is overwritten with an error or blank, the previous query results are still contained in the ‘All Messages’ field.

    However, as a way to accomplish exactly what you want to do, you could have your task check to see if the target computer is online first before trying to obtain the MAC. This way the MAC field will not be overwritten with an error when the machine is offline.

    In the current version of BP there is no “Get MAC” option in the job queue, but we will consider adding it. In the meantime you can create a custom remote command (logged output) with the following syntax:

    WMIC PATH Win32_NetworkAdapterConfiguration WHERE "IPEnabled=True" GET MacAddress

    Then create a job queue that looks like this:

    Step 1: Wait for host to be detected online
    Step 2: Execute your custom command to get the MAC

    Or this queue below actually probably works better for your needs since you want to just run the task periodically:

    Step 1: If host is offline, goto label:X
    Step 2: Execute your custom command to get the MAC
    Step 3: Label:X

    Then create a scheduled task that executes the job queue at the desired time.

    —————

    With all of that said, I really don’t understand at all what your actual need is here. I mean to say that I don’t understand why it would ever make sense to continually/repeatedly query a target computer for its MAC address, when MAC addresses do not ever change. Perhaps you could fill me in on more details. The better I understand your actual need, the more likely we would be able to address it sufficiently, if we were to add something to the software for this purpose. However, at the moment I simply don’t understand why you’re repeatedly querying targets for their MACs. On the surface this just doesn’t make sense to me. Thanks.

    #12600
    laurie
    Participant

    Hi Doug
    The solution you suggested above (using labels) worked just fine for me so thanks again.

    My need is an edge case. We churn laptops faster than most and new laptops appear in AD regularly. Being the nature of our business laptops go bush for a day or 2 before returning to head office. Having a task to get new laptop’s MAC address but not delete any existing MAC addresses from currently offline laptop is useful to me. I then schedule this task at 12:30 each day. Over a week I will update the grid with newly discovered MACs.

    Hope this makes sense. Anyway what you have provided above answers my problem

    #12601
    doug
    Moderator

    Ok great. Glad that works. Thanks.

    -Doug

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.