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)
Please log in to answer
Posted by:
jknox
9 years ago
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
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
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
9 years ago
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 9 years ago