|
|
Rank: Freeware Member Groups: Member
Joined: 5/2/2008 Posts: 26 Location: Ohio, USA
|
Here is a custom action I setup so that we can change the computer description. Code:cmd.exe cscript \\SERVER\SHARE\change_comp_desc.vbs {computer} and here is the VBscript code: Code:Set WshNetwork = WScript.CreateObject("WScript.Network") strComputer = Wscript.Arguments.Item(0) strDescription = Inputbox("Enter Description:") Set Obj= GetObject("winmgmts:\\" & strComputer).InstancesOf("Win32_OperatingSystem") For Each x In Obj x.Description = strDescription x.Put_ Next WScript.Quit Pops up an input box for you to enter the computer description. Please let me know if anyone sees anything that could be improved with this script or custom action. thanks, Eric
|
|
 Rank: Premium user Groups: Member
, Premium Users
Joined: 1/24/2008 Posts: 13 Location: UK
|
That's a really good idea, why didnt i think of it! I got it to work but i needed to change the following: strComputer is defined at the top as strC Omputer. Also i needed to change the Action to just begin with cscript and strip off the cmd.exe for some reason, i know it shouldnt make any difference, but just incase anyone else gets the same problem, it was just bringing up the command prompt before i changed it. Thanks for this ejensen. Optilan Communication Systems www.optilan.com
|
|
Rank: Freeware Member Groups: Member
Joined: 5/2/2008 Posts: 26 Location: Ohio, USA
|
yeah, sorry about the type-o there. i fixed it in the original post.
interesting that you had to strip out the cmd.exe, mine works fine. wonder how others will be effected.
|
|
Rank: Freeware Member Groups: Member
Joined: 5/6/2008 Posts: 17 Location: Ellenville, NY
|
I have done everything with this script as you put it, but when i enter the description in the box nothing happens. Doesn't update even tried a refresh of page.
|
|
Rank: Freeware Member Groups: Member
Joined: 5/2/2008 Posts: 26 Location: Ohio, USA
|
it wont show in the web page until the next scan. I would run it against your own computer and then verify the change by right-clicking the my computer icon and going to the computer name tab.
|
|
 Rank: Administration Groups: Administration
Joined: 2/10/2005 Posts: 1,451 Location: Hamme Belgium
|
Also note that you need to have administrative permissions on the client computer when running this script.
Thanks ejensen for the script, it's really valuable.
|
|
Rank: Freeware Member Groups: Member
Joined: 5/2/2008 Posts: 26 Location: Ohio, USA
|
glad to be able to share. Another thought i had about this script is that with WMI sometimes you have to use impersonation due to security warnings. so if anyone is having problems running this script, they may have to do that. i can provide some help if that need arises. Eric
|
|
Rank: Freeware Member Groups: Member
Joined: 5/6/2008 Posts: 17 Location: Ellenville, NY
|
Thanks you trick worked.
Goes away with head between legs.
|
|
Rank: Freeware Member Groups: Member
Joined: 5/2/2008 Posts: 26 Location: Ohio, USA
|
No worries jreimer, i actually did the exact same thing at first. i couldnt figure out why it wasnt updating. :)
|
|
Rank: Freeware user Groups: Member
Joined: 7/9/2008 Posts: 4 Location: Germany
|
Hello, I bring this to work in IE7 and with the following action: Quote:cmd.exe /K \\COMPUTER\SHARE\change_comp_desc.vbs {computer} I must remove the cscript and must add /K to cmd.exe . You can also use /C instead of /K if you like to close the windows if the job is done. After calling this in the browser I get the trust warning and be able to set the description on XPpro workstations and Win2K3 Server. /update I test it on Win2K machines too. It seems that the script put the description in. I can fin it in the registry under [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]] in the key srvcomment. I remove my testcomputer from lansweeper, reboot my testcomputer to take effect of the changes and after booting I run lsclient again. The computer comes up in Lansweeper but the description field in Lansweeper is still empty. /update 2 on some computer it begin to work. I'm not sure what blocks some of them. I will dig a little bit more. Thanks for sharing this action Regards Andreas
|
|
|
Guest |