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")