Skip to content

SCCM OSD Computer Name Change

Featured Replies

On 8/28/2016 at 7:14 PM, tregelen said:

This should work (I haven't tested it because im not at work atm)


$var = New-Object -ComObject Microsoft.SMS.TSEnvironment
$OSDComputerName = $var.Value("OSDComputerName")
$var.Value("OSDComputerName") = ($OSDComputerName).Replace("TW7", "TW10")

Hi i am trying to do this same tasks except for different computer names

 

i need help .. so am i taking the code below and creating a package w/ or without program? Do i save the code as .ps1 then in my TS I  add-->general-->Powershell Script? choose the package i created the script name below as .ps1 and choose bypass ?  in what stage of the TS do i run this as i cannot get it to work ?   Help would be greatly appreciated in getting this working.  Also is there another way i can create a program or package per se and then just deploy it to a Lab already in production that just needs thier names changed from like H206 to H205  the room number has changed in the computer names.

$var = New-Object -ComObject Microsoft.SMS.TSEnvironment
$OSDComputerName = $var.Value("OSDComputerName")
$var.Value("OSDComputerName") = ($OSDComputerName).Replace("TW7", "TW10")
  • Replies 21
  • Views 19.7k
  • Created
  • Last Reply

Top Posters In This Topic

Posted Images

20 hours ago, djm1k0 said:

Hi i am trying to do this same tasks except for different computer names

 

i need help .. so am i taking the code below and creating a package w/ or without program? Do i save the code as .ps1 then in my TS I  add-->general-->Powershell Script? choose the package i created the script name below as .ps1 and choose bypass ?  in what stage of the TS do i run this as i cannot get it to work ?   Help would be greatly appreciated in getting this working.  Also is there another way i can create a program or package per se and then just deploy it to a Lab already in production that just needs thier names changed from like H206 to H205  the room number has changed in the computer names.


$var = New-Object -ComObject Microsoft.SMS.TSEnvironment
$OSDComputerName = $var.Value("OSDComputerName")
$var.Value("OSDComputerName") = ($OSDComputerName).Replace("TW7", "TW10")

I knew this was a super old post, but hoping to bring it back to life. BUMP

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.