![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Change MachineName via PowerShell I'm new to Windows PowerShell so I apologize if I missed something obvious. I would like to write a script that will change the MachineName and then reboot the PC. I think I can figure out the reboot part but I searched many places and I can't figure out how to change the MachineName. I'm trying to set up a generic VM that will be used to test different configurations of software and part of the testing requires different machine names so I would like to write a script that sets up the VM with the test environment which includes a specific machine name and then reboots the PC/VM. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Change MachineName via PowerShell For PowerShell 1.0 you can use: 1) netdom.exe utility 2) Rename method in Win32_ComputerSystem WMI class For PowerShell V2 you can use Rename-Computer cmdlet. -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "Shane Wealti" <ShaneWealti@xxxxxx> rakstīja ziņojumā "news:84C94186-C2AD-430A-9E6D-0B4EF0780D2D@xxxxxx"... Quote: > I'm new to Windows PowerShell so I apologize if I missed something > obvious. I > would like to write a script that will change the MachineName and then > reboot > the PC. I think I can figure out the reboot part but I searched many > places > and I can't figure out how to change the MachineName. I'm trying to set > up a > generic VM that will be used to test different configurations of software > and > part of the testing requires different machine names so I would like to > write > a script that sets up the VM with the test environment which includes a > specific machine name and then reboots the PC/VM. > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Change MachineName via PowerShell Rename-Computer doesn't exist anymore on CTP3, I wonder why. --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar V> For PowerShell 1.0 you can use: V> 1) netdom.exe utility V> 2) Rename method in Win32_ComputerSystem WMI class V> For PowerShell V2 you can use Rename-Computer cmdlet. V> "Shane Wealti" <ShaneWealti@xxxxxx> rakst?ja V> zi?ojum? "news:84C94186-C2AD-430A-9E6D-0B4EF0780D2D@xxxxxx"... V> Quote: Quote: >> I'm new to Windows PowerShell so I apologize if I missed something >> obvious. I >> would like to write a script that will change the MachineName and >> then >> reboot >> the PC. I think I can figure out the reboot part but I searched many >> places >> and I can't figure out how to change the MachineName. I'm trying to >> set >> up a >> generic VM that will be used to test different configurations of >> software >> and >> part of the testing requires different machine names so I would like >> to >> write >> a script that sets up the VM with the test environment which includes >> a >> specific machine name and then reboots the PC/VM. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Change MachineName via PowerShell mmm..at this time Rename-Computer appear in latest official CTP3 release (from connect). -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "Shay Levy [MVP]" <no@xxxxxx> rakstīja ziņojumā "news:95d808937dd298cb9b27bc06aab0@xxxxxx"... Quote: > Rename-Computer doesn't exist anymore on CTP3, I wonder why. > > > --- > Shay Levy > Windows PowerShell MVP > http://blogs.microsoft.co.il/blogs/ScriptFanatic > PowerShell Toolbar: http://tinyurl.com/PSToolbar > > > > V> For PowerShell 1.0 you can use: > V> 1) netdom.exe utility > V> 2) Rename method in Win32_ComputerSystem WMI class > V> For PowerShell V2 you can use Rename-Computer cmdlet. > V> "Shane Wealti" <ShaneWealti@xxxxxx> rakst?ja > V> zi?ojum? "news:84C94186-C2AD-430A-9E6D-0B4EF0780D2D@xxxxxx"... > V> Quote: Quote: >>> I'm new to Windows PowerShell so I apologize if I missed something >>> obvious. I >>> would like to write a script that will change the MachineName and >>> then >>> reboot >>> the PC. I think I can figure out the reboot part but I searched many >>> places >>> and I can't figure out how to change the MachineName. I'm trying to >>> set >>> up a >>> generic VM that will be used to test different configurations of >>> software >>> and >>> part of the testing requires different machine names so I would like >>> to >>> write >>> a script that sets up the VM with the test environment which includes >>> a >>> specific machine name and then reboots the PC/VM. > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Change MachineName via PowerShell I'm running CTP3 and it does exist by I can't get it to work. For example, I'm running it on a local PC named CAR01 and I want to change it to CAR05. I run (from the Integrated Scripting Environmnet): Rename-Computer -newcomputername CAR05 -PassThru -verbose And it gives me the error: This command cannot be executed on target computer('localhost') due to the following error: The RPC server is unavailable. I checked and the RPC service is running on the PC that I'm running the command on. I can ping localhost. Also I tried with the firewall on and off and it made no difference. It seems like there might be some kind of issue with the credentials or powershell having permission to do a "remote" procedure call even though it's running on the local computer. "Shay Levy [MVP]" wrote: Quote: > Rename-Computer doesn't exist anymore on CTP3, I wonder why. > > > --- > Shay Levy > Windows PowerShell MVP > http://blogs.microsoft.co.il/blogs/ScriptFanatic > PowerShell Toolbar: http://tinyurl.com/PSToolbar > > > > V> For PowerShell 1.0 you can use: > V> 1) netdom.exe utility > V> 2) Rename method in Win32_ComputerSystem WMI class > V> For PowerShell V2 you can use Rename-Computer cmdlet. > V> "Shane Wealti" <ShaneWealti@xxxxxx> rakst?ja > V> zi?ojum? "news:84C94186-C2AD-430A-9E6D-0B4EF0780D2D@xxxxxx"... > V> Quote: Quote: > >> I'm new to Windows PowerShell so I apologize if I missed something > >> obvious. I > >> would like to write a script that will change the MachineName and > >> then > >> reboot > >> the PC. I think I can figure out the reboot part but I searched many > >> places > >> and I can't figure out how to change the MachineName. I'm trying to > >> set > >> up a > >> generic VM that will be used to test different configurations of > >> software > >> and > >> part of the testing requires different machine names so I would like > >> to > >> write > >> a script that sets up the VM with the test environment which includes > >> a > >> specific machine name and then reboots the PC/VM. > > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Change MachineName via PowerShell try netdom or WMI. -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "Shane Wealti" <ShaneWealti@xxxxxx> rakstīja ziņojumā "news:E4E66121-86F1-45C6-9C97-CFAF2DD2DB85@xxxxxx"... Quote: > I'm running CTP3 and it does exist by I can't get it to work. For example, > I'm running it on a local PC named CAR01 and I want to change it to CAR05. > > I run (from the Integrated Scripting Environmnet): > > Rename-Computer -newcomputername CAR05 -PassThru -verbose > > And it gives me the error: > > This command cannot be executed on target computer('localhost') due to the > following error: The RPC server is unavailable. > > I checked and the RPC service is running on the PC that I'm running the > command on. I can ping localhost. Also I tried with the firewall on and > off > and it made no difference. It seems like there might be some kind of issue > with the credentials or powershell having permission to do a "remote" > procedure call even though it's running on the local computer. > > > "Shay Levy [MVP]" wrote: > Quote: >> Rename-Computer doesn't exist anymore on CTP3, I wonder why. >> >> >> --- >> Shay Levy >> Windows PowerShell MVP >> http://blogs.microsoft.co.il/blogs/ScriptFanatic >> PowerShell Toolbar: http://tinyurl.com/PSToolbar >> >> >> >> V> For PowerShell 1.0 you can use: >> V> 1) netdom.exe utility >> V> 2) Rename method in Win32_ComputerSystem WMI class >> V> For PowerShell V2 you can use Rename-Computer cmdlet. >> V> "Shane Wealti" <ShaneWealti@xxxxxx> rakst?ja >> V> zi?ojum? "news:84C94186-C2AD-430A-9E6D-0B4EF0780D2D@xxxxxx"... >> V> Quote: >> >> I'm new to Windows PowerShell so I apologize if I missed something >> >> obvious. I >> >> would like to write a script that will change the MachineName and >> >> then >> >> reboot >> >> the PC. I think I can figure out the reboot part but I searched many >> >> places >> >> and I can't figure out how to change the MachineName. I'm trying to >> >> set >> >> up a >> >> generic VM that will be used to test different configurations of >> >> software >> >> and >> >> part of the testing requires different machine names so I would like >> >> to >> >> write >> >> a script that sets up the VM with the test environment which includes >> >> a >> >> specific machine name and then reboots the PC/VM. >> >> |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Change MachineName via PowerShell Thanks for checking, it should be missing on post CTP3 builds. --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar V> mmm..at this time Rename-Computer appear in latest official CTP3 V> release (from connect). V> V> "Shay Levy [MVP]" <no@xxxxxx> rakst?ja zi?ojum? V> "news:95d808937dd298cb9b27bc06aab0@xxxxxx"... V> Quote: Quote: >> Rename-Computer doesn't exist anymore on CTP3, I wonder why. >> >> --- >> Shay Levy >> Windows PowerShell MVP >> http://blogs.microsoft.co.il/blogs/ScriptFanatic >> PowerShell Toolbar: http://tinyurl.com/PSToolbar >> V> For PowerShell 1.0 you can use: >> V> 1) netdom.exe utility >> V> 2) Rename method in Win32_ComputerSystem WMI class >> V> For PowerShell V2 you can use Rename-Computer cmdlet. >> V> "Shane Wealti" <ShaneWealti@xxxxxx> rakst?ja >> V> zi?ojum? >> "news:84C94186-C2AD-430A-9E6D-0B4EF0780D2D@xxxxxx"... >> V> Quote: >>>> I'm new to Windows PowerShell so I apologize if I missed something >>>> obvious. I >>>> would like to write a script that will change the MachineName and >>>> then >>>> reboot >>>> the PC. I think I can figure out the reboot part but I searched >>>> many >>>> places >>>> and I can't figure out how to change the MachineName. I'm trying >>>> to >>>> set >>>> up a >>>> generic VM that will be used to test different configurations of >>>> software >>>> and >>>> part of the testing requires different machine names so I would >>>> like >>>> to >>>> write >>>> a script that sets up the VM with the test environment which >>>> includes >>>> a >>>> specific machine name and then reboots the PC/VM. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Change IE Settings with Powershell | PowerShell | |||
| Using PowerShell to change service descriptions | PowerShell | |||