/build/static/layout/Breadcrumb_cap_w.png

Update computer description to service tag

Hey guys

I need your help.
I want to create a vbscript or similar to be able to update computer descriptions for selected computers with the service tag. 
I have been searching around for a solution, and the only one I have found is a logon script through the AD: https://4sysops.com/archives/automatically-fill-the-computer-description-field-in-active-directory/#comment-291126

As I really want to be able to do it through KACE, for different reasons, I really hope some of you can help me :-)

Best,   
Alex

0 Comments   [ + ] Show comments

Answers (4)

Posted by: jknox 8 years ago
Red Belt
1
You can set computer description with this command run as an administrator in a Kscript:

net config server /srvcomment:"your_computer_description"

You can return the service tag using: wmic bios get serialnumber

If you wanted to script it further outside of the K1000 to pull the service tag, I'd start here: http://blogs.technet.com/b/heyscriptingguy/archive/2005/12/07/how-can-i-change-the-description-for-a-computer.aspx

Here's an older ITNinja article that might be helpful also: http://www.itninja.com/question/how-to-change-computer-name-computer-description-using-k1000


Posted by: johnbodden 8 years ago
Senior White Belt
0
I know this is an old post but I use this one to set the local computer description to the Service tag and model # of the PC. Remove name in the wmic command if you just want the service tag

@echo off
SetLocal EnableDelayedExpansion
set count=0
for /F "delims=," %%a in ('"wmic csproduct get identifyingnumber,Name"')do (
  set compdesc=%%a
  set /a count=!count! + 1
  if !count! GTR 1 goto rename
)
:rename
net config server /srvcomment:"Service Tag: %compdesc%"
:Exit

Comments:
  • Hey John. I fixed it myself with a batch file:

    REM set variables
    set serialnumber=


    REM Get Computer Serial Number
    FOR /F "tokens=2 delims='='" %%A in ('wmic Bios Get SerialNumber /value') do SET serialnumber=%%A

    @reg add HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters /v srvcomment /t reg_sz /d #"%serialnumber%" /f

    goto END

    :NOCON
    echo Error...Invalid Operating System...
    echo Error...No actions were made...
    goto END

    :END - HQgeN 8 years ago
Posted by: FSU Facilities 8 years ago
Yellow Belt
0
You can do it with a batch file, however, just like the manual method of changing the name of a computer; a reboot will be required afterwards.

@ECHO OFF
set PC=ch-newcomputername
wmic path win32_computersystem where "Name='%computername%'" CALL rename name='%PC%'

Comments:
  • Thanks! What about computer description? - HQgeN 8 years ago
Posted by: HQgeN 8 years ago
Senior White Belt
0
What about the computer description?
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ