Hello Windows-noob community! I wonder if there's something you could help me with?
The task:
- Populate the "Manged By" attribute of a computer object during OSD
What I have so far:
- A custom page in my UDI Wizard as follows
The managed by field has the OSDManagedBy task sequence variable populated for it
- The PowerShell
#Create OSD Task Sequence Environment Object
$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
#Get the ComputerDescription
$strComputerDesc = $tsenv.Value("OSDComputerDesc")
#Get the ManagedBy Name
$strManagedBy = $tsenv.Value(“OSDManagedBy”)
#Computer Name
$strName = $env:computername
#Set the Active Directory Object Properties
Set-ADComputer "$strName" -ManagedBy "$strManagedBy"
Now, when fill in the strName and strManagedBy variables manually in the script, it goes off without a hitch. But I have it running right after the "Install Software" step in my task sequence and hence, the reason I'm here - it's not working.
Any tips?