Why install MDT when a simple Powershell script does the same thing?
$TSEnv = New-Object -COMObject Microsoft.SMS.TSEnvironment
$CompName = $TSEnv.Value("OSDComputerName")
Switch -Wildcard ($CompName) {
"StartsWith*" { $TSEnv.Value("OSDDomainOUName") =
"LDAP://OU=TestOU,DC=TestDomain,DC=com" }
"StartsWith2*" { $TSEnv.Value("OSDDomainOUName") =
"LDAP://OU=TestOU,DC=TestDomain,DC=com" }
}
I don't have any ability to test this easily, but it should work.
On Wed, May 13, 2015 at 1:07 AM, Roland Janus <[email protected]>
wrote:
> Really…? You should change that. Really…
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Murray, Mike
> *Sent:* Mittwoch, 13. Mai 2015 01:30
> *To:* [email protected]
> *Subject:* RE: [mssms] OSD - WMI query for computer name not working as
> expected
>
>
>
> No MDT here, so I believe that’s not an option.
>
>
>
> *From:* [email protected] [
> mailto:[email protected] <[email protected]>] *On
> Behalf Of *Roland Janus
> *Sent:* Tuesday, May 12, 2015 4:15 PM
> *To:* [email protected]
> *Subject:* RE: [mssms] OSD - WMI query for computer name not working as
> expected
>
>
>
> I don’t have that many rules, simply computer name patter, but I use
> customsettings.ini and a userexit script to set the OU variable (can’t
> remember the exact name) and let the regular domain join step do that using
> the variable.
>
> So, the script defines the variable, the step uses it. No (complicated)
> conditions required.
>
>
>
> -roland
>
>
>
>
>
> *From:* [email protected] [
> mailto:[email protected] <[email protected]>] *On
> Behalf Of *Murray, Mike
> *Sent:* Dienstag, 12. Mai 2015 19:12
> *To:* [email protected]
> *Subject:* [mssms] OSD - WMI query for computer name not working as
> expected
>
>
>
> We have a domain join step that evaluates conditions based on an HTA the
> tech fills out before imaging begins. Depending on these conditions, the
> computer joins the domain and is placed in the appropriate OU. There are 3
> main conditions we evaluate:
>
>
>
> OSDRole – TS variable, can be lab, staff, etc.
>
> OSDBusinessArea – Another TS variable, based on department
>
>
>
> These evaluate fine in our conditions when joining the domain. But the
> other condition does a WMI query for the computer name. Unfortunately, at
> this point in the imaging process, the computer name in WMI is
> MININT-XXXXXXX, so it evaluates as FALSE.
>
>
>
>
>
> Do we need to move this step down further in our TS? I don’t know how else
> to evaluate the computer name (OSDComputerName is available, but there is
> no “LIKE” statement).
>
>
>
>
>
> Any help appreciated!
>
>
>
>
>
> Best Regards,
>
>
>
> Mike Murray
>
> Desktop Management Coordinator - IT Support Services
>
> California State University, Chico
>
> 530.898.4357
> [email protected]
>
>
>
>
>
>
>
>
>
>