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

0 Comments   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer


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.
Answered 03/22/2012 by: ewagner
Orange Belt

  • I use netdom command and it gets the job done for what i need it to do
Please log in to comment
Answer this question or Comment on this question for clarity


Try adding this to the end of your command:
That way we can see what the exact error is.
Answered 03/23/2012 by: dchristian
Red Belt

  • I would do this, or log in with the same account that ran WSname initially and look for WSname.log in %temp%
Please log in to comment
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.
Answered 03/23/2012 by: Moedius
Blue Belt

Please log in to comment
That all looks right to me. It could possibly an issue with the namedb.bat file.
Answered 03/21/2012 by: WGM_Jeff
Fourth Degree Black Belt

  • 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?
Please log in to comment