Deployment Solution

 View Only
  • 1.  Renaming a computer to the same as it's asset tag?

    Posted Jun 22, 2010 06:15 AM
    Hi there guys and girls,

    Im trying to create a job that will rename my machines to it's asset tag number. The tokens provided with the configuration job does not contain a token for the asset tag.
    Any ideas how i can do this?

    I am using DS 6.9 SP4...

    Thanks
    Eugene


  • 2.  RE: Renaming a computer to the same as it's asset tag?

    Posted Jun 22, 2010 06:19 AM
    If the asset tag is in the bios then you need a bit of WMI code to read it
    Something like this:

    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colEnclosures = objWMIService.ExecQuery("Select * from Win32_SystemEnclosure",,48)
       
    For Each colEnclosure in colEnclosures
     strAssetID = "NULL"
     strAssetID = colEnclosure.SMBIOSAssetTag
    Next
       
    If strAssetID = "NULL" then  
     msgbox "NO ASSET TAG SET!!" 
     wscript.quit
    End if
      
    ' Strip out unwanted spaces
       
    strAssetID = rtrim(ltrim(strAssetID)) 
    Msgbox "Current Asset Tag in Bios is: " & strAssetIDstrcomputer = "."


  • 3.  RE: Renaming a computer to the same as it's asset tag?

    Posted Jul 06, 2010 09:19 AM
    Would it be possible to do the reverse l need to change the asset tag to the computer name l can do individual machines usin HPCM but l need to automate into the deployment job dont fancy doing 1500 machines one at a time any help would be apreciated

    ANDY K