retrieving new custom properties via scripts as variables

Sep 23, 2010 at 10:07 AM

All.

Using MDTweb front end on MDT2010update1, I've added in about half a dozen new custom properties.

I've added the names of those new properties into the customsettings.ini under the [settings] section so that the line reads Properties=MycustomProperty,BUSINESSCONTACT,TECHNICALCONTACT, etc etc

The intention is that the value entered in for these values from the MDTwebfront end are picked up by a wsf script in the task sequence and writen out to the registry for further use.

the script does the following :-

<job id="BuildRegistry">
   <script language="VBScript" src="ZTIUtility.vbs"/>
   <script language="VBScript">

Dim strComputer,  strCBKeyPath, strValue, strValueName

strComputer = "."

Set objRegistry = GetObject("winmgmts:\\" & _
    strComputer & "\root\default:StdRegProv")

strValueName = "TECHNICALCONTACT"
strValue = oEnvironment.Item("TECHNICALCONTACT")
objRegistry.SetStringValue HKEY_LOCAL_MACHINE,strCBKeyPath,strValueName,strValue


</script>
</job>

Now teh script for for any properties taht are built into MDT, however it fails to pick up the value for those properties that I've extended via teh MDTweb front end.

the ztigather.log files do however indicate that a value for these properties has been picked up by MDT.

Anyone have any ideas? I beleive when extending the database, taht added new custom settings via MDT Web front and and adding the lines mentioned above to customsettings.ini is all that has to be done?

Copuld it be that these properties are not acvaully environment variables at this stage but something else?

 

Coordinator
Sep 30, 2010 at 10:09 AM

Hi Spikey,

you said that the ztigather.log indicates that the values for these properties have been picked up. Do you mean ZTIGather has recognized them as custom variables or does it really show the values from the database being assigned to the properties?

If they just show up as a custom property but not getting a value at all it might be that the "ComputerSettings" view in the Database hasn't been updated. The Web FrontEnd should take care about this but fails as soon as someone has ever modified this view by hand. Just run a SELECT * FROM ComputerSettings WHERE ID = 1 (or any other valid ID) and see if the custom properties you hvae added show up.

If the values have been assigned to the properties, they should be available via oEnvironment.Item("Propertyname") element so it should work as described.

Regards

Maik

Sep 30, 2010 at 11:44 AM

Maik,

Thanks for the email. Coincidentally, managed to get the issue resolve just this morning so I now have environment variables representing both built in Properties and those that have been added.

So it’s now working as designed.

Thanks

MDTWEbFrontEND is such a great product, without it , realistically we’d have ended up writing code to allow people to write to the sql database, felt very nervous about opening up the deployment workbench to everyone along with making sure that they put the right information into one of the 200 odd properties.

Thanks

‘Spikey’

From: MaikKoster [mailto:notifications@codeplex.com]
Sent: 30 September 2010 10:10
To: Prior, Andrew
Subject: Re: retrieving new custom properties via scripts as variables [mdtcustomizations:228290]

From: MaikKoster

Hi Spikey,

you said that the ztigather.log indicates that the values for these properties have been picked up. Do you mean ZTIGather has recognized them as custom variables or does it really show the values from the database being assigned to the properties?

If they just show up as a custom property but not getting a value at all it might be that the "ComputerSettings" view in the Database hasn't been updated. The Web FrontEnd should take care about this but fails as soon as someone has ever modified this view by hand. Just run a SELECT * FROM ComputerSettings WHERE ID = 1 (or any other valid ID) and see if the custom properties you hvae added show up.

If the values have been assigned to the properties, they should be available via oEnvironment.Item("Propertyname") element so it should work as described.

Regards

Maik

Read the full discussion online.

To add a post to this discussion, reply to this email (mdtcustomizations@discussions.codeplex.com)

To start a new discussion for this project, email mdtcustomizations@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE PRIVILEGED. If this message was misdirected, BlackRock, Inc. and its subsidiaries, ("BlackRock") does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BlackRock, unless the author is authorized by BlackRock to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by BlackRock. Although BlackRock operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.