djm1k0 Posted November 7, 2017 Report post Posted November 7, 2017 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") Quote Share this post Link to post Share on other sites More sharing options...
djm1k0 Posted November 8, 2017 Report post Posted November 8, 2017 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 Quote Share this post Link to post Share on other sites More sharing options...