MSFN Forum: Unattended Change Computer Name - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Unattended Change Computer Name Rate Topic: -----

#1 User is offline   Batcompu 

  • Group: Members
  • Posts: 5
  • Joined: 17-August 04

Posted 12 January 2006 - 08:22 AM

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


#2 User is offline   RogueSpear 

  • OS: SimplyMEPIS
  • Group: Supreme Sponsor
  • Posts: 1,529
  • Joined: 18-September 04

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:

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 User is offline   Batcompu 

  • Group: Members
  • Posts: 5
  • Joined: 17-August 04

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


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 User is offline   Shamwari 

  • Newbie
  • Group: Members
  • Posts: 43
  • Joined: 12-January 05

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

#5 User is offline   Batcompu 

  • Group: Members
  • Posts: 5
  • Joined: 17-August 04

Posted 13 January 2006 - 04:33 AM

View PostShamwari, 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



It Looks great.

I will test it.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy