Welcome to Symantec Connect.  Log in or register to participate.

SQL statement to custom database in unattend file

jbuddy's picture

Hi Everyone,

I am attempting to place an sql script call to a custom database to retrieve information about a server for install, i.e IP address. I am new to altiris but someone mentioned to me to place this call into the unattend file, however it has not worked. Here is a snippet

[params.MS_TCPIP.Adapter1]
SpecificTo=Adapter1
DHCP=No
IPAddress=%#custdata*"SELECT n.ipaddress FROM nic AS n INNER JOIN server AS s ON n.serverid = s.serverid WHERE (s.hostname = {COMPNAME}"%
SubnetMask=255.255.255.0
DefaultGateway=X.X.X.X
DNSServerSearchOrder=X.X.X.X,X.X.X.X
WINS=Yes
WinsServerList=X.X.X.X,X.X.X.X
NetBIOSOptions=0
DNSDomain=corpblah.blah.com

If there is a better way to do this please let me know.

jbuddy's picture

Figured it out myself..

The syntax was incorrect

IPAddress=%#custdata*"SELECT ipaddress FROM nic WHERE hostname = '%COMPNAME%'"%

I created a view as well so not to have to join tables inside of the unattend.txt

Let me know if you have questions