0

I am trying to rename a computer name on a Windows Embedded POS Ready 2009 OS. I am trying to update the computername with the following syntax:

:: COMPUTER NAME CHANGE OUTPUT TO POWERSHELL FILE
echo $sysInfo = Get-WmiObject -Class Win32_ComputerSystem >> ComputerName.ps1
echo. >> ComputerName.ps1
echo $sysInfo.Rename("%PCNAME%") >> ComputerName.ps1

:: CALL POWERSHELL FILE TO RENAME COMPUTER
REM Powershell.exe set-executionpolicy unrestricted > output_ps.txt

REM PowerShell.exe -File ComputerName.ps1 >> output_ps.txt

echo COMPUTER NAME WILL CHANGE TO %PCNAME% AFTER RESTARTING THE COMPUTER
Ping -n 2 127.0.0.1>nul

I restart the computer, and sadly this does not appear to rename the computer. This is working on all other OS'es except for the Windows Embedded POS Ready 2009 OS.

Any ideas why this works on XP and others, but not this OS?

NerdyBird
  • 109
  • 1
  • 5
  • 11

1 Answers1

0
Rename-Computer [-NewName] <String> [-ComputerName <String> ] [-DomainCredential <PSCredential> ] [-Force] [-LocalCredential <PSCredential> ] [-PassThru] [-Restart] [-Confirm] [-WhatIf] [ <CommonParameters>]

http://technet.microsoft.com/en-us/library/hh849792.aspx

This is how your powershell script should look. Not sure what's in as you just call it and output the results. Can you post your script?

Hituptony
  • 2,740
  • 3
  • 22
  • 44