cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
khaleehh
Engaged Sweeper II
Hey ,
I was tring to made action to change computer name using VBS :

Set WshNetwork = WScript.CreateObject("WScript.Network")
strComputer = Wscript.Arguments.Item(0)
strName = Inputbox("Enter Computer Name:")
Set objWMIService = GetObject("winmgmts:\\" & strComputer).InstancesOf("Win32_ComputerSystem")
For Each x In objWMIService
x.rename(strName)
Next
WScript.Quit

put still not working with me , any help ?
1 ACCEPTED SOLUTION
EB
Engaged Sweeper III
netdom RENAMECOMPUTER wrongname /newname:rightname /userd:admin /passwordd:* /force


pause


I use this as a batchfile.....works well....you have to enter the password when you run it and it requires a reboot of the machine...

View solution in original post

4 REPLIES 4
ehj
Engaged Sweeper
Hi

This tool support renaming computer with scripts.

https://www.forensit.com/downloads.html

R. Einar.
emarroyo
Engaged Sweeper III
What if i wanted it to default to the user who is logged in userid?
EB
Engaged Sweeper III
netdom RENAMECOMPUTER wrongname /newname:rightname /userd:admin /passwordd:* /force


pause


I use this as a batchfile.....works well....you have to enter the password when you run it and it requires a reboot of the machine...
Susan_A
Lansweeper Alumni
Question received and answered via email. Posting our reply here as well.
Hi,

unfortunately we can't offer support for writing custom action scripts.

If default actions like "Open C$" don't work, could you send us a screenshot of the error message on your screen.

Note: Actions are being executed on your Lansweeper server. In order to execute a script on a target machine, you need to create a deployment package and deploy it to the target computer.