locked
Custom properties added to MDT database, values return blank in query. Why? RRS feed

  • Question

  • I am having issues with some custom properties that i have added to the MDT database for scripting Out Of Band management.

    They have been successfully added to the database, the view has been refreshed and from the MDT management workbench i am also able to see the custom properties.

    

    I have also successfully injected values from my prestaging script as can also be seen from the screenshot.

    The issue is, when i try to fetch the values from the database, they return blank.

    In my customsettings.ini i have also added the properties:

    [Settings]
    Priority=CSettings, CRoles, RSettings, TaskSequenceID, Default
    Properties=OOBIPAddress, OOBSubnetmask, OOBGateway, OOBPassword

    The script i am using to try to fetch the properties looks as follows

    if($MDTIntegration -eq "YES"){    $OOBIPAddress = $tsenv.Value("OOBIPAddress")    $OOBSubnetmask = $tsenv.Value("OOBSubnetmask")    $OOBGateway = $tsenv.Value("OOBGateway")    Write-Output "$ScriptName - IP Address: $OOBIPAddress"    Write-Output "$ScriptName - Subnet Prefix Length: $OOBSubnetmask"    Write-Output "$ScriptName - Gateway: $OOBGateway"}


    If i use the same script for some of the built-in properties, they return just fine and as expected:

    if($MDTIntegration -eq "YES"){    $IPAddress = $tsenv.Value("OSDAdapter0IPAddressList")    $Subnetmask = $tsenv.Value("OSDAdapter0SubnetMask")    $Gateway = $tsenv.Value("OSDAdapter0Gateways")    Write-Output "$ScriptName - IP Address: $IPAddress"    Write-Output "$ScriptName - Subnet Prefix Length: $Subnetmask"    Write-Output "$ScriptName - Gateway: $Gateway"}


    Both scripts are making use of the $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment. So it has something to do with the properties in some way.

    I am totally puzzled and have used so  many hours to find out why - on the edge of giving up.

    Maybe it is something simple - i really hope you guys have an answer - 'cause i'm tearing out my hair!

    Findings:

    Although I have refreshed the view as suggested in many articles that describe adding custom values, i do not see the new values in the actual updated view. Here in stead is a long list of properties specified. But not those added. Could this have something to do with it?

    • Edited by lazerpld Tuesday, December 6, 2016 3:45 PM
    Tuesday, December 6, 2016 1:49 PM

Answers

  • After involving a SME from the database team, the solution was found.

    So basically i wanted to add custom properties, so i could handle the scripting of the Out Of Band management cards on the customers HP ProLiant Servers.

    I followed the below articles to do so.

    Article 1

    Article 2

    Both of them state to run an update of the database view, implying that all values are already selected.

    But updating the view did not help, and the variables were still unavailable, although in the database.

    Finally the database SME, looked inside the actual view, and found that the view was comprised of single named properties, and not a select all. Since this was the case, the customized values were not there.

    After adding the custom values to the list in the view - the properties now worked. 

    I have added a screenshot for better understanding.

    In the bottom you can see that the values were added.

    Hope this will help someone with the same problem.

    • Marked as answer by lazerpld Wednesday, December 7, 2016 7:23 AM
    Wednesday, December 7, 2016 7:23 AM

All replies

  • Hello lazerpld,

    I believe that query runs against the current loaded variables in the environment and not the database directly. When the gather step is run, the CSettings of the database are processed and the environment variables are then updated with what is found in the database.

    For computers, for a match from the database to be returned there has to be a unique identifier (the mac address). Check the BDD logs to see what is being found during the CSettings process. That log will show if there are any errors communicating with the database as well. Here is an example of the BDD log from one of my deployments that shows it found a matching mac address entry and processed the variables found in the database, including my custom property NMWDeploymentType:

    ------ Processing the [CSETTINGS] section ------	ZTIGather	11/18/2016 6:43:48 AM	0 (0x0000)
    Determining the INI file to use.	ZTIGather	11/18/2016 6:43:48 AM	0 (0x0000)
    Using DEFAULT VALUE: Ini file = \\servername.com\DeploymentShare$\Control\CustomSettings.ini	ZTIGather	11/18/2016 6:43:48 AM	0 (0x0000)
    Finished determining the INI file to use.	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Using specified INI file = \\servername.com\DeploymentShare$\Control\CustomSettings.ini	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    CHECKING the [CSETTINGS] section	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Using from [CSETTINGS]: SQLServer = servername.com	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Using from [CSETTINGS]: Instance = SQLEXPRESS	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Port key not defined in the section [CSETTINGS]	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Using from [CSETTINGS]: Database = MDT	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Using from [CSETTINGS]: Netlib = DBNMPNTW	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Using from [CSETTINGS]: Table = ComputerSettings	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    StoredProcedure key not defined in the section [CSETTINGS]	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    DBID key not defined in the section [CSETTINGS]	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    DBPwd key not defined in the section [CSETTINGS]	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Using from [CSETTINGS]: SQLShare = DeploymentShare$	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Using from [CSETTINGS]: ParameterCondition = OR	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Validating connection to \\servername.com\DeploymentShare$	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Mapping server share: \\servername.com\DeploymentShare$	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Found Existing UNC Path Z: = \\servername.com\DeploymentShare$	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Found Existing UNC Path Z: = \\servername.com\DeploymentShare$	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Successfully established connection using supplied credentials.	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    OPENING TRUSTED SQL CONNECTION to server servername.com.	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Connecting to SQL Server using connect string: Provider=SQLOLEDB;OLE DB Services=0;Data Source=servername.com\SQLEXPRESS;Initial Catalog=MDT;Network Library=DBNMPNTW;Integrated Security=SSPI	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Successfully opened connection to database.	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    About to issue SQL statement: SELECT * FROM ComputerSettings WHERE UUID = '13EF1742-55F2-2569-BA0C-FB5E5620C969' OR ASSETTAG = 'No Asset Tag' OR SERIALNUMBER = 'VMware-42 17 ef 13 f2 55 69 25-ba 0c fb 5e 56 20 c9 69' OR MACADDRESS IN ('00:50:56:97:C5:30')	ZTIGather	11/18/2016 6:43:49 AM	0 (0x0000)
    Successfully queried the database.	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Records returned from SQL = 1	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Property OSINSTALL is now = YES	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Obtained OSINSTALL value from SQL:  OSINSTALL = YES	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Property OSDCOMPUTERNAME is now = 2016S-ES-T-X01	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Obtained OSDCOMPUTERNAME value from SQL:  OSDCOMPUTERNAME = 2016S-ES-T-X01	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Property TASKSEQUENCEID is now = 2016S-ES-C	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Obtained TASKSEQUENCEID value from SQL:  TASKSEQUENCEID = 2016S-ES-C	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Value for KEYBOARDLOCALE is already set to en-US so database value of es-ES will be ignored.	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Property INPUTLOCALE is now = es-ES	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Obtained INPUTLOCALE value from SQL:  INPUTLOCALE = es-ES	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Property SYSTEMLOCALE is now = es-ES	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Obtained SYSTEMLOCALE value from SQL:  SYSTEMLOCALE = es-ES	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Property USERLOCALE is now = es-ES	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Obtained USERLOCALE value from SQL:  USERLOCALE = es-ES	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Property UILANGUAGE is now = es-ES	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Obtained UILANGUAGE value from SQL:  UILANGUAGE = es-ES	ZTIGather	11/18/2016 6:43:50 AM	0 (0x0000)
    Property SKIPCOMPUTERNAME is now = Yes	ZTIGather	11/18/2016 6:43:51 AM	0 (0x0000)
    Obtained SKIPCOMPUTERNAME value from SQL:  SKIPCOMPUTERNAME = Yes	ZTIGather	11/18/2016 6:43:51 AM	0 (0x0000)
    Property SKIPTASKSEQUENCE is now = Yes	ZTIGather	11/18/2016 6:43:51 AM	0 (0x0000)
    Obtained SKIPTASKSEQUENCE value from SQL:  SKIPTASKSEQUENCE = Yes	ZTIGather	11/18/2016 6:43:51 AM	0 (0x0000)
    Property NMWDEPLOYMENTTYPE is now = VRA7TEMPLATE	ZTIGather	11/18/2016 6:43:53 AM	0 (0x0000)
    Obtained NMWDEPLOYMENTTYPE value from SQL:  NMWDEPLOYMENTTYPE = VRA7TEMPLATE	ZTIGather	11/18/2016 6:43:53 AM	0 (0x0000)

    Regards,

    DLofstedt

    Wednesday, December 7, 2016 4:05 AM
  • Hi DLofstedt, 

    Thank you for your input. After tireless hours, i involved a SME from the database team. After informing him about the issue and showing him, that articles on adding custom properties, said to update a view in the database, he got the idea that maybe the view itself did not contain the added properties. We found out this, since updating the view didnt work. And BINGO. After altering the view of the settings, the values were now available.

    Have yourself a good day.

    Wednesday, December 7, 2016 7:16 AM
  • After involving a SME from the database team, the solution was found.

    So basically i wanted to add custom properties, so i could handle the scripting of the Out Of Band management cards on the customers HP ProLiant Servers.

    I followed the below articles to do so.

    Article 1

    Article 2

    Both of them state to run an update of the database view, implying that all values are already selected.

    But updating the view did not help, and the variables were still unavailable, although in the database.

    Finally the database SME, looked inside the actual view, and found that the view was comprised of single named properties, and not a select all. Since this was the case, the customized values were not there.

    After adding the custom values to the list in the view - the properties now worked. 

    I have added a screenshot for better understanding.

    In the bottom you can see that the values were added.

    Hope this will help someone with the same problem.

    • Marked as answer by lazerpld Wednesday, December 7, 2016 7:23 AM
    Wednesday, December 7, 2016 7:23 AM