Rename computer whilst in domain
Hi,
I have post install task to rename a PC whilst it's in the domain, unfortunately i can't get it to work. It's running following scripted install which itself joins the PC to the domain but with a random name. I would like to rename it to a unique number from a list. The following is what I have been using, any ideas on where i might be going wrong?
wsname.exe /RDF:namedb.dat /DFK:$MAC /rcid /user:domain\account /pass:password
Thanks!
I have post install task to rename a PC whilst it's in the domain, unfortunately i can't get it to work. It's running following scripted install which itself joins the PC to the domain but with a random name. I would like to rename it to a unique number from a list. The following is what I have been using, any ideas on where i might be going wrong?
wsname.exe /RDF:namedb.dat /DFK:$MAC /rcid /user:domain\account /pass:password
Thanks!
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
ewagner
12 years ago
Here's the command I use to accomplish the same thing:
netdom renamecomputer oldname /newname:newname /userd:DOMAIN\account /passwordd:password /Force
Perhaps you'll have better luck with NETDOM, versus WSNAME. NETDOM will accept variables as values, so you can easily incorporate it into a batch file to pipe in that unique number you want to use.
netdom renamecomputer oldname /newname:newname /userd:DOMAIN\account /passwordd:password /Force
Perhaps you'll have better luck with NETDOM, versus WSNAME. NETDOM will accept variables as values, so you can easily incorporate it into a batch file to pipe in that unique number you want to use.
Comments:
-
I use netdom command and it gets the job done for what i need it to do - shigbee 12 years ago
Posted by:
dchristian
12 years ago
Try adding this to the end of your command:
/LOGFILE:C:\name.txt
That way we can see what the exact error is.
/LOGFILE:C:\name.txt
That way we can see what the exact error is.
Comments:
-
I would do this, or log in with the same account that ran WSname initially and look for WSname.log in %temp% - warmep 12 years ago
Posted by:
Moedius
12 years ago
Just a thought, if you havent tried something like this already - I've seen a similar issue in the past using deployment solution. The problem was identical though, a post build task to rename the workstation and re-add to the domain was failing, and while it's been some years and I dont recall the source of the problem, I do remember that it was related to timing, and we had to put a pause in prior to the task running to get it to work.
Posted by:
WGM_Jeff
12 years ago
That all looks right to me. It could possibly an issue with the namedb.bat file.
Comments:
-
Tried again manually from a command prompt window and it does work but for some reason as a Post Install task it doesn't and i'm not sure why.
Created the post install task again, zipped wsname.exe and namedb.dat file and used the same command line as a new application task. Same problem. Any ideas? - amjreh 12 years ago -
- ewagner 12 years ago