Hey Hello,
I'm Not working with RIS From microsoft but with a Other programm Called Unattended.
It almost does the same as RIS but this supports more NIC's and does some other things automatic.
But wat I want to know is How I can Change The Computername Unattended.
What I want is:
It Looks in The AD for existing computernames and makes an new one.
I've heard It's possible whit VBS but I have'nt found a good script yet
so maby someone from here could help.
I hope so
Greetz,
Batcompu
Page 1 of 1
Unattended Change Computer Name
#2
Posted 12 January 2006 - 01:07 PM
I made a hypertext application using VBscript that displays a dialog box for the user to enter the computer name, and some usernames and passwords. The basic gist of renaming a computer in VBscript is as follows:
You can substitue the variable strName with a direct name of "ComputerName". Note that the quotes are necessary if not using a variable. But you can derive strName in any number of ways that you see fit.
Dim strComputer, objWMIService, colComputers, objComputer, strName
strComputer="."
Set objWMIService=GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colComputers=objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
For Each objComputer in colComputers
Err = ObjComputer.Rename(strName)
Next
You can substitue the variable strName with a direct name of "ComputerName". Note that the quotes are necessary if not using a variable. But you can derive strName in any number of ways that you see fit.
#3
Posted 13 January 2006 - 03:45 AM
Ok It almost Works But when I make strName variable (without the qoutes) I'm getting the next error:
Row: 6
Character: 1
Code: 8004102F
Error: Wrong Paramater(s)
Source: SWbemObjectEX
And can I ad something to the computername that isn't variable + a variable number.
Because all our Computers are Named "Clone" + the variable Number.
Row: 6
Character: 1
Code: 8004102F
Error: Wrong Paramater(s)
Source: SWbemObjectEX
Dim strComputer, objWMIService, colComputers, objComputer, strName
strComputer="."
Set objWMIService=GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colComputers=objWMIService.ExecQuery("Select * from
Win32_ComputerSystem")
For Each objComputer in colComputers
Err = ObjComputer.Rename ("strName")
Next
And can I ad something to the computername that isn't variable + a variable number.
Because all our Computers are Named "Clone" + the variable Number.
#4
Posted 13 January 2006 - 03:56 AM
I don't know if this tool can help, but I found it very useful:
Workstation Name Changer
Hope it helps.
Shamwari
Workstation Name Changer
Hope it helps.
Shamwari
#5
Posted 13 January 2006 - 04:33 AM
Shamwari, on Jan 13 2006, 03:56 AM, said:
I don't know if this tool can help, but I found it very useful:
Workstation Name Changer
Hope it helps.
Shamwari
Workstation Name Changer
Hope it helps.
Shamwari
It Looks great.
I will test it.
Share this topic:
Page 1 of 1



Help
Back to top








