Extract the service tag set to system description
I would like a batch file to take the service tag from pc and set it to the system description
0 Comments
[ + ] Show comments
Answers (2)
Answer Summary:
Please log in to answer
Posted by:
RaginX
12 years ago
Hi ddonaldson,
you can get the service tag via wmi, see powershell example below. but i think this is vendor dependent!
Powershell:
Get-WmiObject win32_SystemEnclosure | select serialnumber
kind regards,
raginx
you can get the service tag via wmi, see powershell example below. but i think this is vendor dependent!
Powershell:
Get-WmiObject win32_SystemEnclosure | select serialnumber
kind regards,
raginx
Comments:
-
yes but I also needto change the system description - ddonaldson 12 years ago
Posted by:
RaginX
12 years ago
Yeah, not sure if this works. couldn't check this at the moment:
have a look at registry path HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\lanmanserver\parameters\srvcomment
have a look at registry path HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\lanmanserver\parameters\srvcomment
Comments:
-
you can with for exemple this script in autoit :
#include
#include
#include
Dim $assettag
RunWait("cmd.exe /c " & "wmic /node:localhost systemenclosure get smbiosassettag > c:\Temp\assettag.txt", "",@SW_HIDE)
$file = FileOpen("C:\Temp\assettag.txt", 0)
$assettag = FileReadLine($file,2)
FileClose($file)
RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters", "srvcomment", "REG_SZ", $assettag)
FileDelete ("C:\Temp\assettag.txt") - nekkar 12 years ago -
Now this, I'm keeping in my stash. Nice one nekkar. - Roonerspism 12 years ago