Jump to content

segujl

Member
  • Posts

    5
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About segujl

Profile Information

  • OS
    none specified

segujl's Achievements

0

Reputation

  1. @CoffeeFiend. THANK YOU VERY MUCH I am going to start using this tomorrow after i get the txt file with the service tags and resource codes together. I understood to save it as a plain txt file not a csv file. Is that correct? Have a great evening.
  2. @gunsmokingman. I updated my post to include the information i have and the help i need to put it together. Sorry, i gave you the impression i wanted you to do my work. If you can still help I would appreciate it.
  3. @ gunsmokingman. thanks for the code. Sorry i'm not good with scripting but as i read through it i think i may have added some confusion as to what i needed. I modified and uploaded the only important file which includes 2 items (service tag# in column1 and resource code in column2). What i need the script to do is the following *query the service tag of the local machine strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colBIOS = objWMIService.ExecQuery _ ("Select * from Win32_BIOS") For each objBIOS in colBIOS WScript.StdOut.WriteLine objBIOS.SerialNumber Next *check the servicetag_resourcedoe file and see if it is listed in column1 I'm not sure how to scipt this but the file would be located on \\do-staff-srv\techsupport$ *if it is listed in column 1, then i need it to change the computer description and add the resource code in column2 (if possible add the description in AD) the registry key that needs to be modified is ([HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters]" srvcomment"="RES-3550") *if it is not on the list then it should just exit the script with no error message Thanks. I appreciate any further help you can provide. Servicetag_ResourceCode_example.txt
  4. Thanks for your quick response. The list is an excel spreadsheet but it can be saved in what ever format you think is better to work with. I saved it as a csv file with 2 columns (1st column header is serial, 2nd column header is resource) I tried to upload a sample but i wasn't permitted so i uploaded the funding source code list and a text file example of the spreadsheet. The file will be saved on \\do-staff-srv\techsupport$ I originally wanted the resource code to be changed in the description field so i could query it using SCCM but it would be nice to have the info in Active Directory as well. Hopefully it isn't to much more work. Also, is this code that i would call or include in our login script so that as machines are added to the csv file they can receive these changes upon user login? I also found this vb code to get the service tag. Hope it helps strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colBIOS = objWMIService.ExecQuery _ ("Select * from Win32_BIOS") For each objBIOS in colBIOS WScript.StdOut.WriteLine objBIOS.SerialNumber Next Funding Source Codes_Example.txt Servicetag_ResourceCode_example.txt
  5. I have a project where i have a list of computers with the following info: service tag, funding source. I need to create a script that runs with a group policy to query the machine for its service tag then using an if, then statement look up the service tag in the list and if it exist change the computer description to the funding source code. For example, computer A with service tag# 7LK*** is on the list and has funding source 3550 then I need to modify the computer description to RES-3550. I found the following code that gets the local service tag# (c:\wmic bios get serialnumber >) and the registry key that needs to be modified ([HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters]"srvcomment"="RES-3550") but don't know how to link the two. Please help.
×
×
  • Create New...