# Script to Change PC name with prefix + Serialnumber

**URL:** <https://forum-upgrade-test.xcitium.com/t/script-to-change-pc-name-with-prefix-serialnumber/19112>\
**Category:** Request a Script\
**Created:** [January 7, 2025, 4:03pm UTC](https://forum-upgrade-test.xcitium.com/t/script-to-change-pc-name-with-prefix-serialnumber/19112 "2025-01-07T16:03:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vartabedian](https://forum-upgrade-test.xcitium.com/letter_avatar_proxy/v4/letter/v/919ad9/32.png) [@vartabedian](https://forum-upgrade-test.xcitium.com/u/vartabedian)\
**Post date:** [January 7, 2025, 4:03pm UTC](https://forum-upgrade-test.xcitium.com/t/script-to-change-pc-name-with-prefix-serialnumber/19112/1 "2025-01-07T16:03:11Z")

</div>

Hello. I am hoping to get a script created to rename PC’s with a prefix and the PC serial number. I have a powershell script that should work but open to anything else.

$SerialNumber = (Get-WmiObject -class win32\_bios).SerialNumber  
$computer = “PrefixHere-$SerialNumber”  
Rename-Computer -NewName $computer -Force

With changing PrefixHere to what prefix I am looking for example would be USAV-Serialnumber. I see there is a script to run a powershell script but involves the .ps1 file to be copied to the pc first which is not an option in my case.

---

<div class="post-metadata">

**Author:** ![nivedithab](https://forum-upgrade-test.xcitium.com/user_avatar/forum-upgrade-test.xcitium.com/nivedithab/32/883_2.png) [@nivedithab](https://forum-upgrade-test.xcitium.com/u/nivedithab)\
**Post date:** [January 7, 2025, 4:03pm UTC](https://forum-upgrade-test.xcitium.com/t/script-to-change-pc-name-with-prefix-serialnumber/19112/2 "2025-01-07T16:03:28Z")

</div>

hi @PremJKumar

please do look into this request.

thank you

---

<div class="post-metadata">

**Author:** ![PremJKumar](https://forum-upgrade-test.xcitium.com/user_avatar/forum-upgrade-test.xcitium.com/premjkumar/32/883_2.png) [@PremJKumar](https://forum-upgrade-test.xcitium.com/u/PremJKumar)\
**Post date:** [January 7, 2025, 7:25pm UTC](https://forum-upgrade-test.xcitium.com/t/script-to-change-pc-name-with-prefix-serialnumber/19112/3 "2025-01-07T19:25:17Z")

</div>

Hi @vartabedian ,

Thanks for your script request. we have created an internal script task “CS-61493” and assigned it to our script developer.

Kind Regards,  
PremJK

---

<div class="post-metadata">

**Author:** ![PremJKumar](https://forum-upgrade-test.xcitium.com/user_avatar/forum-upgrade-test.xcitium.com/premjkumar/32/883_2.png) [@PremJKumar](https://forum-upgrade-test.xcitium.com/u/PremJKumar)\
**Post date:** [April 21, 2025, 8:31am UTC](https://forum-upgrade-test.xcitium.com/t/script-to-change-pc-name-with-prefix-serialnumber/19112/4 "2025-04-21T08:31:09Z")

</div>

Hi @vartabedian ,

Our script developer has provided script as requested  
[https://scripts.xcitium.com/frontend/web/topic/script-to-change-pc-name-with-prefix-and-serial-number](https://scripts.xcitium.com/frontend/web/topic/script-to-change-pc-name-with-prefix-and-serial-number)

**Note:** Run the script as Local System User

You can change the variable “prefix”  
prefix = “COMP” # You can change this to any desired prefix

it will automatically restart the computer within 60 seconds(which can be changed).

Kind Regards,  
PremJK
