Answered by:
Powershell change hostname in a joined domain

Question
-
Hi, I use the powershell to change a machine name, I use $name as variable to input a name and the follow cmd-let: $computerName.Rename($name) but it only work in a unjoined domain machine.
my script is the following:
$computerName = Get-WmiObject Win32_ComputerSystem
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
$name = [Microsoft.VisualBasic.Interaction]::InputBox("Enter Desired Computer Name ")
$computername.rename("$name")but I need to change the hostname of any computer joined in my domain, may be it's another command, I don't know and I can't find information seeking the web.
If somebody knows something I'll be pleasure to know it.
Thursday, January 16, 2014 12:49 PM
Answers
-
Trank, this is a Windows or PowerShell issue - please submit on one of those forums instead of here.
- PowerShell forum: http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell
- Windows server general forum: http://social.technet.microsoft.com/Forums/en-US/home?forum=winservergen
- Marked as answer by cara chenModerator Friday, January 24, 2014 8:57 AM
Thursday, January 16, 2014 12:56 PM -
Hi Trank,
We have a dedicated support team regarding the Microsoft Window Server. I recommend you ask your question on our Windows Server PowerShell forum which is staffed by more experts specializing in this kind of problems. Thanks for your understanding.
For your convenience:
http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershellIf you have any problems with Exchange, welcome to our Exchange forum.
Best regards,
AmyAmy Wang
TechNet Community Support- Marked as answer by cara chenModerator Friday, January 24, 2014 8:57 AM
Friday, January 17, 2014 8:19 AMModerator
All replies
-
Trank, this is a Windows or PowerShell issue - please submit on one of those forums instead of here.
- PowerShell forum: http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell
- Windows server general forum: http://social.technet.microsoft.com/Forums/en-US/home?forum=winservergen
- Marked as answer by cara chenModerator Friday, January 24, 2014 8:57 AM
Thursday, January 16, 2014 12:56 PM -
Please check out Rename-computer cmdlet
http://technet.microsoft.com/en-us/library/hh849792.aspx
MCITP - Exchange 2010 | MCITP - Windows Server 2008 R2
Thursday, January 16, 2014 12:58 PM -
Hi Trank,
We have a dedicated support team regarding the Microsoft Window Server. I recommend you ask your question on our Windows Server PowerShell forum which is staffed by more experts specializing in this kind of problems. Thanks for your understanding.
For your convenience:
http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershellIf you have any problems with Exchange, welcome to our Exchange forum.
Best regards,
AmyAmy Wang
TechNet Community Support- Marked as answer by cara chenModerator Friday, January 24, 2014 8:57 AM
Friday, January 17, 2014 8:19 AMModerator -
Ok, I've done an ask in the appropriate place, thanks, we can close this issue.
Friday, January 17, 2014 2:52 PM