Re: Renaming computers using Logon scripts from GPO
- From: "Jorge Silva" <jorgesilva_pt@xxxxxxxxxxx>
- Date: Thu, 13 Nov 2008 00:05:15 -0000
Ok,
Note, I never tested this, but you can give it a try and let us know. I already used psexec for many different things, but never to rename computers, sometimes things can get a little bit complicated, but other times they're very sinple and in most times running psexec against large number of machines can save you a lot of work, at least to me :).
-Psexec can use a list that loads all pcs and perform a given job remotely on those computers. For example (for test purposes) you can create a file name mynetworkpcs.txt and place that file under "C:\". Download psexec from http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx, also note that you have a full syntax sample at this link for the psexec.exe. Ok, after downloading the psexec.exe, place it under C:\ next to mynetworkpcs.txt. The next step is to load the mynetworkpcs.txt with the pcs IP address or names, but since that you're changing the PC name, I would suggest using the IP address if possible. After that you need to create a batch file named tmp.bat and place it under "C:". Inside that batch file insert the following code "cmd", save the file and close it.
Now, there're many ways to do the same thing, but I could give you an example... a simple way to do a test is to play with simple cmds, for example:
go to cmd and change directory to "C:\"
Then from cmd type:
Psexec \\@mynetworkpcs.txt -c "tmp.bat"
Press enter and you will get direct access to the cmd on that machine, on that cmd you could use:
Netdom renamecomputer %computername% /NewName:<NewComputerName> /Force /Reboot:0
or
WMIC ComputerSystem Where Name=%COMPUTERNAME% Call Rename Name=”NewName”
Then psexec will move over the next IP, etc…
As you can see you can use the psexec with a simple batch file to run that batch file as if you were in that PC. Now think about it, you can use this tool in a simple manner or in a complicated way, for example you may need to copy files, open sessions, run setups remotely, etc... In some scenarios you can do that using only one batch file, in other scenarios you can do it using different batch files and different psxecs cmds or mixing all together:
psexec \\@mynetworkpcs.txt -c "opensessions.bat"
psexec \\@mynetworkpcs.txt -c "copythefiles.bat"
psexec \\@mynetworkpcs.txt -c "runsetup.bat"
psexec \\@mynetworkpcs.txt -c "deletethefiles.bat"
etc.. etc.. etc...
Ok, since that you need to automate the new name thing, you can use a script where you could use a fixed variable with a numeric increment. And mix all together.
As I told you from the beginning I never used this tool to rename computers, or perhaps you may find other tools that do the same thing with less work, but since you can use this tool to open, or copy your own scripts and then run them from remote location, does not sound impossible (to me) to automate this job. All I'm giving you is a better knowledge of this tool so you can use it as you want.
--
I hope that the information above helps you.
Have a Nice day.
Jorge Silva
MCSE, MVP Directory Services
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
"VV" <VV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:E4A5CF7A-9B1D-45EF-8A8B-2216C0A15A80@xxxxxxxxxxxxxxxx
Thank you,
Can you pls explain how I can do this using PSexec
"Jorge Silva" wrote:
Hi
Logon scripts? That means that each user must have permissions to do that,
or that the administrator must logon in all computers!!!
Alternative, Use psexec from sysinternals to remotely run the netdom
renamecomputer cmd.
http://support.microsoft.com/kb/298593
--
I hope that the information above helps you.
Have a Nice day.
Jorge Silva
MCSE, MVP Directory Services
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
"VV" <VV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8857D188-4006-4B21-9AE0-A3DCA0247FBA@xxxxxxxxxxxxxxxx
> Folks,
> I want to rename around 500 computers using Logon scripts from GPO. Can
> you
> pls suggest any script for the same??
>
> This is very urgent!!!!
.
- References:
- Renaming computers using Logon scripts from GPO
- From: VV
- Re: Renaming computers using Logon scripts from GPO
- From: Jorge Silva
- Re: Renaming computers using Logon scripts from GPO
- From: VV
- Renaming computers using Logon scripts from GPO
- Prev by Date: Unable to access PC on the domain even as administrator
- Next by Date: upgrade plan to 2008
- Previous by thread: Re: Renaming computers using Logon scripts from GPO
- Next by thread: Upgrade foreset to 2008
- Index(es):
Relevant Pages
|
Loading