I used a VBS script to accomplish something far less complex than this. Put 
your logics in, but here's the meat.

Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")
'Code to define the value of sCompName
oTaskSequence("OSDComputername") = sCompName

As you may have guessed, the above script will set the Task Sequence variable 
OSDComputerName to whatever you need when you call it from your Task Sequence. 
You can also accomplish this in PowerShell as well, see below.

$TS_Env = New-Object -COMObject Microsoft.SMS.TSEnvironment
#Code to define $sCompName
$TS_Env.Value("OSDComputername") = $sCompName

Hope that helps,

Andrew

From: [email protected] [mailto:[email protected]] On 
Behalf Of Marcum, John
Sent: Thursday, July 25, 2013 9:12 AM
To: SMS List ([email protected])
Subject: [mssms] Complex Computer Naming

In customsettings.ini is it possible to use more than one condition to set 
OSDComputerName? Has anyone done something like this?


Here's what I am trying to accomplish.

1. Default gateway?
2. Physical or Virtual?
3. If physical is laptop or is desktop?
4. serial number if physical UUID if virtual

And I want to end up with a name like this;

First 4 character:
default gateway = 10.10.10.10 or 10.10.10.20 - first 4 letters of computer name 
are "BHM-"

Next two characters:
Virtual is YES - next two letters of computer name are "V-"
Laptop is Yes - - next two letters of computer name are "L-"
Desktop is Yes - - next two letters of computer name are "D-"

Last characters of computer name:

If physical then "serial number"
if virtual then VM#Right(replace("%UUID%"," ",""),8)#

End result would be something like this:

BHM-D-12345678
JKS-L-12345678
NSV-V-12345678






________________________________
John Marcum
Sr. Desktop Architect
Bradley Arant Boult Cummings LLP
________________________________


________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.




Reply via email to