Jump to content

copy MAC address to new application


Recommended Posts

hello,

i'm upgrading our end-users to the latest cisco ip communicator version(from 2.0 to 2.1). there is a MAC address i need to get from the old (2.0) to use for the new version (2.2). i want to get the MAC address, then add it to the upgraded version during the install.

here is a screenshot of where the MAC address is located.

Posted Image

any ideas would be great, otherwise i guess i will use Window Info, or have to open the application manually and add the MAC after the install.

thanks for any help or suggestions.

;~~~~~~~~~~~~~~~~~~~~~~~~ uninstall of 2.0

ProgressOn("IP Communicator 2.0", "IP Communicator 2.0 Uninstalling", "5 percent")
ProgressSet( 15,"15 percent")
Sleep(500)
ProgressSet( 30,"30 percent")
Sleep(500)
RunWait (@ComSpec & ' /c "msiexec /x {9A315CF2-DBBA-42AB-B3CB-95616040CC22} /q"', @TempDir, @SW_HIDE)
ProgressSet( 45,"45 percent")
Sleep(500)
ProgressSet( 50,"50 percent")
Sleep(500)
ProgressSet( 65,"65 percent")
Sleep(500)
ProgressSet( 80,"80 percent")
Sleep(500)
ProgressSet( 100,"100 percent","IP Communicator 2.0 Uninstall Complete!")

sleep(1000)

;~~~~~~~~~~~~~~~~~~~ upgade to 2.1
$destination = "\\server\f1\f2\Images\blah.gif"

SplashImageOn("IP 2.1 Communicator", $destination,362,483)
Sleep(10000)
SplashOff()

ProgressOn("IP Communicator 2.1", "IP Communicator 2.1 Installing", "5 percent")
ProgressSet( 15,"15 percent")
Sleep(500)
ProgressSet( 30,"30 percent")
Sleep(500)
RunWait (@ComSpec & ' /c "msiexec /i \\server\f1\f2\f3\CiscoIPCommunicatorSetup.msi /q"', @TempDir, @SW_HIDE)
ProgressSet( 45,"45 percent")
Sleep(500)
ProgressSet( 50,"50 percent")
Sleep(500)
ProgressSet( 65,"65 percent")
Sleep(500)
ProgressSet( 80,"80 percent")
Sleep(500)
ProgressSet( 100,"100 percent","IP Communicator 2.1 Install Complete!")

sleep(1000)

$destination = "\\server\f1\f2\Images\blah.gif"

SplashImageOn("IP 2.1 Communicator", $destination,362,483)
Sleep(5000)
SplashOff()
Link to comment
Share on other sites

how about using WMI imformation to get the MAC address.

; Generated by AutoIt Scriptomatic

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$Output=""
$Output = $Output & "Computer: " & $strComputer  & @CRLF
$Output = $Output & "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
      $Output = $Output & "AdapterType: " & $objItem.AdapterType & @CRLF
      $Output = $Output & "AdapterTypeId: " & $objItem.AdapterTypeId & @CRLF
      $Output = $Output & "AutoSense: " & $objItem.AutoSense & @CRLF
      $Output = $Output & "Availability: " & $objItem.Availability & @CRLF
      $Output = $Output & "Caption: " & $objItem.Caption & @CRLF
      $Output = $Output & "ConfigManagerErrorCode: " & $objItem.ConfigManagerErrorCode & @CRLF
      $Output = $Output & "ConfigManagerUserConfig: " & $objItem.ConfigManagerUserConfig & @CRLF
      $Output = $Output & "CreationClassName: " & $objItem.CreationClassName & @CRLF
      $Output = $Output & "Description: " & $objItem.Description & @CRLF
      $Output = $Output & "DeviceID: " & $objItem.DeviceID & @CRLF
      $Output = $Output & "ErrorCleared: " & $objItem.ErrorCleared & @CRLF
      $Output = $Output & "ErrorDescription: " & $objItem.ErrorDescription & @CRLF
      $Output = $Output & "Index: " & $objItem.Index & @CRLF
      $Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
      $Output = $Output & "Installed: " & $objItem.Installed & @CRLF
      $Output = $Output & "LastErrorCode: " & $objItem.LastErrorCode & @CRLF
      $Output = $Output & "MACAddress: " & $objItem.MACAddress & @CRLF
      $Output = $Output & "Manufacturer: " & $objItem.Manufacturer & @CRLF
      $Output = $Output & "MaxNumberControlled: " & $objItem.MaxNumberControlled & @CRLF
      $Output = $Output & "MaxSpeed: " & $objItem.MaxSpeed & @CRLF
      $Output = $Output & "Name: " & $objItem.Name & @CRLF
      $Output = $Output & "NetConnectionID: " & $objItem.NetConnectionID & @CRLF
      $Output = $Output & "NetConnectionStatus: " & $objItem.NetConnectionStatus & @CRLF
      $strNetworkAddresses = $objItem.NetworkAddresses(0)
      $Output = $Output & "NetworkAddresses: " & $strNetworkAddresses & @CRLF
      $Output = $Output & "PermanentAddress: " & $objItem.PermanentAddress & @CRLF
      $Output = $Output & "PNPDeviceID: " & $objItem.PNPDeviceID & @CRLF
      $strPowerManagementCapabilities = $objItem.PowerManagementCapabilities(0)
      $Output = $Output & "PowerManagementCapabilities: " & $strPowerManagementCapabilities & @CRLF
      $Output = $Output & "PowerManagementSupported: " & $objItem.PowerManagementSupported & @CRLF
      $Output = $Output & "ProductName: " & $objItem.ProductName & @CRLF
      $Output = $Output & "ServiceName: " & $objItem.ServiceName & @CRLF
      $Output = $Output & "Speed: " & $objItem.Speed & @CRLF
      $Output = $Output & "Status: " & $objItem.Status & @CRLF
      $Output = $Output & "StatusInfo: " & $objItem.StatusInfo & @CRLF
      $Output = $Output & "SystemCreationClassName: " & $objItem.SystemCreationClassName & @CRLF
      $Output = $Output & "SystemName: " & $objItem.SystemName & @CRLF
      $Output = $Output & "TimeOfLastReset: " & WMIDateStringToDate($objItem.TimeOfLastReset) & @CRLF
      if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
      $Output=""
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_NetworkAdapter" )
Endif


Func WMIDateStringToDate($dtmDate)

    Return (StringMid($dtmDate, 5, 2) & "/" & _
    StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
    & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Link to comment
Share on other sites

Kerros...thank you for the reply.

after some more test runs....so long the users have the old ip communicator installed, the install of the upgrade automatically gets all the information needed so i do not need to uninstall the old, or even worry about getting the MAC address.

thanks again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...