Set oOUList = CreateObject("Microsoft.xmlDOM")
oOUList.Load("DomainOUs.xml")
Maik Koster
Information Services
Subsea Systems
Cameron GmbH
Lückenweg 1
29227 Celle, Germany
Tel.: +49 5141 806 735
Fax: +49 5141 806 333
Maik.Koster@c-a-m.com
Cameron GmbH - Sitz der Gesellschaft: Celle - Handelsregister: Amtsgericht Lüneburg HRB 100653 - Geschäftsführer: George Mackie
From: admin@lists.myITforum.com [mailto:admin@lists.myITforum.com] On Behalf Of Chris Stauffer
Sent: Freitag, 26. Juni 2009 16:00
To: scripting@lists.myitforum.com
Cc: mssms@lists.myitforum.com
Subject: [mssms] RE: [scripting] Create a dynamic radio button list for MDT/OSD
ok i know part of my problem.
I cant get this script to work.
How do i import the existing XML file into this script?
In the Script that Todd uses for TS it uses a dynamic XML that was created from a webservice. But since i already have the XML i just need to get it into this function. but i cant seem to figure out how to declare it as an object.
I'm failing on the line in red.
here is the error
C:\TEMP\OSD_Boot\OA_OSD_Boot\OA_CustomBootWizard.vbs(405, 2) Microsoft VBScript runtime error: Object required: 'OUList'
Function ReadyInitializeOUList
Dim oOUList
Dim bFound
Dim oInput
StrLocation = "\\OASCCM01.pa.lcl\MDT_OSD\Sources$\OU_LIST\"
oOUList = StrLocation & "DomainOUs.xml"
'oLogging.CreateEntry StrLocation & "DomainOUs.XML", LogTypeWarning
'ButtonNext.Disabled = True
If not OUList.readystate = "complete" Then ' this is the line that is failing so OULIST isnt declared
'oLogging.CreateEntry "readystate complete exiting function"
Exit Function
End If
Set oOUList = document.getElementsByName("DomainOUs")
If oOUList is Nothing Then
'oLogging.CreateEntry "no list found.", LogTypeWarning
Exit Function
End If
If oOUList.Length > 0 Then
bFound = False
For each oInput In oOUList
If oInput.Value <> "" And StrComp(oInput.Value,ForceAsString(oProperties("DomainOU")),vbTextCompare) = 0 then
document.all.item(oInput.SourceIndex - 1).click
ButtonNext.Disabled = False
bFound = True
'oLogging.CreateEntry "Parsing list.", LogTypeWarning
End If
Next
If not bFound And oOUList.Item(0).Value <> "" then
' Just select the first item
document.getElementsByName("SelectedItem").Item(0).click
'ButtonNext.Disabled = False
End If
End If
End Function
Thanks,
Christopher Stauffer <><
Enterprise SMS Admin
MCTS ConfigMgr 2007
MCP SMS 2003
Email: CStauffer@myitforum.com
Blog: http://myitforum.com/cs2/blogs/cstauffer/
From: "Chris Stauffer" <cstauffer@myitforum.com>
Sent: Friday, June 26, 2009 8:29 AM
To: scripting@lists.myitforum.com
Subject: RE: [scripting] Create a dynamic radio button list for MDT/OSD
Thanks Mike. I changed the OU XML.
I tried the LT scripts and panel but it wants domain stuff. And i already have that coded into my SCCM TS. I didnt want to give them the choose of using a different account to add it to the domain.
I just wanted to give them 3 thigs to fill in
1. Computer name
2. OU
3. TS option for the image they need
I have 1 and 3 working.
Then walk away :-)
Thanks,
Christopher Stauffer <><
Enterprise SMS Admin
MCTS ConfigMgr 2007
MCP SMS 2003
Email: CStauffer@myitforum.com
Blog: http://myitforum.com/cs2/blogs/cstauffer/
From: "Michael Niehaus" <Michael.Niehaus@microsoft.com>
Sent: Thursday, June 25, 2009 11:52 PM
To: "scripting@lists.myitforum.com" <scripting@lists.myitforum.com>
Subject: RE: [scripting] Create a dynamic radio button list for MDT/OSD
The syntax of the OUs is wrong in the examples - it should be something like:
<?xml version="1.0" encoding="utf-8"?>
<DomainOUs>
<DomainOU>OU=A,OU=Desktops,DC=domain,DC=com</DomainOU>
<DomainOU>OU=B,OU=Desktops,DC=domain,DC=com</DomainOU>
</DomainOUs>
Save this as DomainOUs.xml in the scripts directory and the Lite Touch wizard will automatically pick it up.
Now, integrating the same basic logic into a ConfigMgr pre-execution hook wizard wouldn't be too hard either, especially if you are using MDT 2010 Beta 2 which will have the basic wizard pieces - just copy the pane from Lite Touch.
-Michael
From: admin@lists.myITforum.com [mailto:admin@lists.myITforum.com] On Behalf Of Chris Stauffer
Sent: Thursday, June 25, 2009 11:19 AM
To: scripting@lists.myitforum.com
Cc: mssms@lists.myitforum.com
Subject: re: [scripting] Create a dynamic radio button list for MDT/OSD
The way it is suppose to work in MDT is that you use this XML which would work if i could just figure out how to use it :-)
DomainOUs.xml
<?xml version="1.0" encoding="utf-8"?>
<DomainOUs>
<DomainOU>OU=\OU\AA\Desktops</DomainOU>
<DomainOU>OU=\OU\AB\Laptops</DomainOU>
</DomainOUs>
Thanks,
Christopher Stauffer <><
Enterprise SMS Admin
MCTS ConfigMgr 2007
MCP SMS 2003
Email: CStauffer@myitforum..com
Blog: http://myitforum.com/cs2/blogs/cstauffer/
From: "Chris Stauffer" <cstauffer@myitforum.com>
Sent: Thursday, June 25, 2009 11:13 AM
To: scripting@lists.myitforum.com
Subject: re: [scripting] Create a dynamic radio button list for MDT/OSD
The other thought would be to make the txt file an XML or convert it to XML to make it easier to work with.
Thanks,
Christopher Stauffer <><
Enterprise SMS Admin
MCTS ConfigMgr 2007
MCP SMS 2003
Email: CStauffer@myitforum.com
Blog: http://myitforum.com/cs2/blogs/cstauffer/
From: "Chris Stauffer" <cstauffer@myitforum.com>
Sent: Thursday, June 25, 2009 10:59 AM
To: scripting@lists.myitforum.com
Subject: [scripting] Create a dynamic radio button list for MDT/OSD
I am trying to create a dynamic radio button list for my ODS deployment.
This is what i want to do.
Store a txt file on the SCCM server with a list of approved OU's (this way i can just update the list when needed)
Create a script to read the list and create a list of radio buttons to choose from.
I have parts of the code but i am not sure how to put it all together.
This script will read the file and display the list. I think it needs to be put into a table for the bootwizard.xml to use but i cant find code to put the info into a table.
'*****************************************************************
Option Explicit
Const conForReading = 1
'Declare variables
Dim objFSO, objReadFile, contents
'Set Objects
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFSO.OpenTextFile("\\SCCMSERVER\MDT_OSD\Sources$\OU_LIST\DomainOU.txt", 1, False)
'Read file contents
contents = objReadFile.ReadAll
'Close file
objReadFile.close
'Display results
wscript.echo contents
'Cleanup objects
Set objFSO = Nothing
Set objReadFile = Nothing
'Quit script
WScript.Quit()
'******************************************************************
This input list would be displayed by this code, i took this from something Todd posted to create a dynamic list of Task squences.
This code is still ruff and i dont know that it is correct either. It was meant to be used by a webservice so it doesnt look like i can convert ti to what i need.
<!--############################################################################################################################-->
<Pane id="TS">
<Body><![CDATA[<H1>Choose OU</H1>
<p>Please choose the correct OU for this machine. </p>
<div class=DynamicListBox >
<table id="TSList" datasrc="#tasksequences" mce_src="#tasksequences" width="100%" border=0 cellSpacing=0 language=vbscript onreadystatechange=ReadyInitializeOUList>
<tr valign=top class="DynamicListBoxRow"
onmouseover="javascript:this.className = 'DynamicListBoxRow-over';"
onmouseout="javascript:this.className = 'DynamicListBoxRow';" >
<td class=DynamicListBoxElement width="0px">
<input type=radio name=SelectedItem language=vbscript onPropertyChange="AppItemChange" />
<input type=hidden Name=DomainOUName disabled datafld="OUID"/>
</td>
<td language=vbscript onclick="ClickChildCheckBox" class=DynamicListBoxElement width="100%">
<div>
<Label datafld="Name" class="Larger" ></Label>
</div>
<div>
<Label datafld="Description" dataformatas="HTML"><label class=errmsg style="display: inline;">No OU are available for this site. Please contact your local IS Support.</label></Label>
</div>
</td>
</tr>
</table>
</div>
<xml id="tasksequences" JavaDSOCompatible=true></xml>
]]></Body>
<Initialization>InitializeOUList</Initialization>
<Validation>ValidateOUList</Validation>
</Pane>
<!--############################################################################################################################-->
Any help on this would be great.
I tried to use the MDT built in OU list method but it doesnt work in OSD/MDT for some reason. I dont know maybe i am doing something wrong but everything i found on the internet others are having the same issue.
http://www.myitforum.com/forums/m_203399/mpage_1/key_/tm.htm#203399
Thanks,
Christopher Stauffer <><
Enterprise SMS Admin
MCTS ConfigMgr 2007
MCP SMS 2003
Email: CStauffer@myitforum.com
Blog: http://myitforum.com/cs2/blogs/cstauffer/
=====================
Is managing company email taking up way too much time?
Let users manage archived email through Outlook and drastically
reduce email storage requirements.
Download trial at http://www.gfi.com/mailarchiver/?adv=930&loc=1
=====================
Is managing company email taking up way too much time?
Let users manage archived email through Outlook and drastically
reduce email storage requirements.
Download trial at http://www.gfi.com/mailarchiver/?adv=930&loc=1
=====================
Is managing company email taking up way too much time?
Let users manage archived email through Outlook and drastically
reduce email storage requirements.
Download trial at http://www.gfi.com/mailarchiver/?adv=930&loc=1
=====================
Is managing company email taking up way too much time?
Let users manage archived email through Outlook and drastically
reduce email storage requirements.
Download trial at http://www...gfi.com/mailarchiver/?adv=930&loc=1
==============
Missed an email? Check out the list archive:
http://myitforum.com/cs2/blogs/smslist/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~