/bundles/itninjaweb/img/Breadcrumb_cap_w.png

We are new to the K2000 and have been using the Get/Set Computer name that KACE gave us. My question is, does anyone have a Get/Set computer description application handy, where it prompts for a description and then sets the description later on. We use custom descriptions, so it would be nice to be prompted to type them in.

http://www.itninja.com/blog/view/set-computer-description-during-image-deployment

I tried to use this, but it must be so old it no longer works.

 

1 Comment   [ - ] Hide Comment

Comments

  • I do not have anything ready but I think that something that ask interactively an input to the user is really not a great idea during a deploy process that should be unattended and so silent...
    An alternative idea may be to create a small CSV database file MAC ADDRESS , DESC and a small VBS that :
    1-determines the MAC addess
    2-lookup in the database file is there is a match
    3-set the description

    This can be a post-install task.
    Regards,
    Marco
Please log in to comment

Answer this question or Comment on this question for clarity

Answers

0
We do this with joined by PCs by having a powershell script run to join the PC to our Active Directory, then a VBS Script run to set the description to match the AD description.  (NOTE: I changed all our info to SETME so you know which ones to modify.)

OPTION EXPLICIT
'==========================================================================
'
' NAME: Sync AD and Local Computer Description
'
'==========================================================================
'==========================================================================
' Declare Constants and Variables
'==========================================================================
Const STR_NET_BIOS_DOMAIN = "SETME"
Const STR_USER = "SETME"
Const STR_DOMAIN_USER = "SETME\SETME"
Const STR_PASSWORD = "SETME"
' Constants for the NameTranslate object and server-bind
Const ADS_NAME_INITTYPE_GC = 3
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_TYPE_1779 = 1
Const ADS_SERVER_BIND = &H200
Const ADS_SECURE_AUTHENTICATION = &H1
' Decalare object variables
Dim objComputer, objDescrip, objNetwork, objADComputer
Dim ou, object, objComputerAD
Dim strComputer, strLDdescrip, strEmpty, strBlank
Dim strADPath, strComputerName, strADdescrip, strDescrip
Dim strDCserver

strComputer = "."
strBlank = ""
strEmpty = "EMPTY"
strDCserver = "SETME" 'like domain.com

'==========================================================================
' Pull and adjust local description
'==========================================================================
'Sets string "strLDdescrip" to local computer description
Set objComputer = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objDescrip = objComputer.ExecQuery("Select * FROM Win32_OperatingSystem")
For Each object In objDescrip
strLDdescrip = object.Description
Next
' Line below is for testing
'wscript.echo "Description before empty test = " & strLDdescrip

'Checks to see if local description is empty if so then put EMPTY into local description string
'If StrComp(strLDdescrip, strBlank, 1) = 0 OR IsNull (strLDdescrip) Then
strLDdescrip = "EMPTY"
'End If
' Line below is for testing
'wscript.echo "Local Description = " & strLDdescrip

'==========================================================================
' Connect into AD and get Full AD Path and Description from AD
'==========================================================================
'Get Full Computer Name
SET objNetwork = CREATEOBJECT("Wscript.Network")
strComputerName = objNetwork.ComputerName

ou = getOUByComputerName(strComputerName)

strADPath = "CN=" & strcomputername & "," & ou
'wscript.echo "Full AD Path = " & strADPath

Set objADComputer = GetObject("LDAP:")
Set objComputerAD = ObjADComputer.OpenDSObject("LDAP://" & strDCserver & "/" & strADPath, STR_DOMAIN_USER, STR_PASSWORD, _
ADS_SECURE_AUTHENTICATION Or ADS_SERVER_BIND)
strADdescrip = objComputerAD.Description

'Checks to see if AD description is empty if so then put EMPTY into AD description string
'If StrComp(strADdescrip, strBlank, 1) = 0 Or IsNull (strADdescrip) Then
'strADdescrip = "EMPTY"
'End If
' Line below is for testing
'wscript.echo "AD Before = " & strADdescrip

'===========================================================================
' Conditional Testing for String Manipulation
'===========================================================================
' Check to see LD is empty AND AD is full, if so place AD into LD
' Lines below is for testing
'wscript.echo StrComp(strLDdescrip, strEmpty, 1)
'wscript.echo StrComp(strADdescrip, strEmpty, 1)
'If StrComp(strLDdescrip, strEmpty, 1) = 0 And StrComp(strADdescrip, strEmpty, 1) = -1 Then
' Line below is for testing
'wscript.echo "LD is Empty and AD is Full -1, placing AD into LD"
For Each object In objDescrip
object.Description = strADdescrip
object.put_
' Line below is for testing
'wscript.echo "LD now has " & object.Description
Next
'Elseif StrComp(strLDdescrip, strEmpty, 1) = 0 And StrComp(strADdescrip, strEmpty, 1) = 1 Then
' Line below is for testing
'wscript.echo "LD is Empty and AD is Full 1, placing AD into LD"
For Each object In objDescrip
object.Description = strADdescrip
object.put_
' Line below is for testing
'wscript.echo "LD now has " & object.Description
Next
'Else
' Line below is for testing
'wscript.echo "LD is Full so Placing LD into AD no matter what"
'objComputerAD.Description = strLDdescrip
'objComputerAD.SetInfo
' Line below is for testing
'wscript.echo "Ad now has " & objComputerAD.Description
'End If

' Line below is for testing
'wscript.echo "Script Is Done"

function getOUByComputerName(byval strcomputerName)
' *** Function to find ou/container of computer object from computer name ***
Dim objTrans, strComputerDN
' Retrieve NetBIOS name of local computer.

' Use NameTranslate to convert NT form of computer name into DN.
Set objTrans = CreateObject("NameTranslate")
' Initialize by locating Global Catalog. Specify credentials.
objTrans.InitEx ADS_NAME_INITTYPE_GC, "", STR_USER, STR_NET_BIOS_DOMAIN, STR_PASSWORD
' Use the Set method to specify the NT format of the name.
objTrans.Set ADS_NAME_TYPE_NT4, STR_NET_BIOS_DOMAIN & "\" & strComputerName & "$"
' Use the Get method to retrieve the DN.
strComputerDN = objTrans.Get(ADS_NAME_TYPE_1779)

ou = mid(strComputerDN,instr(strComputerDN,",")+1,len(strComputerDN)-instr(strComputerDN,","))
getOUByComputerName = ou

End Function
Answered 04/10/2018 by: DaveMT
Third Degree Black Belt

Please log in to comment
0

do you have a k1000 also?  We use scripts with labels to set the description via enforce registry settings scripts.  We have one for every deprtment we have.  This is what we use the description for.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters]
"srvcomment"="Academic_Affairs_and_Student_Services"

Answered 02/26/2014 by: SMal.tmcc
Red Belt

Please log in to comment
0

Hi Kevino2010,

It would be easy enough to create yourself a little app that runs in the same way the computer name does, to then save your input and call it later to set the computer description. 

Hope that makes sense!

 

Thanks

Answered 02/27/2014 by: LBarclay
Orange Senior Belt

Please log in to comment