Jump to content


karas321

SCCM 2012 SP1 - How to Get OSDComputerName to the PowerShell Script

Recommended Posts

Hello All,

We are performing LTI with the UDI module. When administrator enters the intended name of the computer we need to get this name (presumably OSDComputerName task sequence variable) and add some text to it. We already got the concatenating portion of the script, but need help with the first part and the third parts. So, basically we need to perform the following sub-tasks:

  1. Get the task sequence variable with the intended computer name which was entered by the administrator.
  2. Verify/modify it (this portion we already implemented)
  3. Set the task sequence variable using the modified computer name.

Would you be so kind to advise on the following questions:

  1. Should we use the OSDComputerName task sequence variable or any other else?
  2. What the code in the PowerShell should be in order to get the input from the administrator and set the new computer name?
  3. What is the proper location of this task should be in the task sequence? We prefer to get it before the OS is installed, but would highly appreciate if you provide is with the location.

 

Also, we received the following error:
PS C:\Windows\system32> $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
New-Object : Cannot load COM type Microsoft.SMS.TSEnvironment.
At line:1 char:20
+ $tsenv = New-Object <<<< -COMObject Microsoft.SMS.TSEnvironment
+ CategoryInfo : InvalidType: ( :) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : CannotLoadComObjectType,Microsoft.PowerShell.Commands.NewObjectCommand

Thank you very much for your time and help!

Share this post


Link to post
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.