Jump to content


Sign in to follow this  
laxi

SCCM 2012, MDT UDI Wizard - how to validate computer name against web service?

Recommended Posts

Hi,

 

I've created a UDI Task sequence with MDT 2012 and SCCM 2012,

 

everything works fine, except i want to validate the computer name the will be inputed in once of the forms against the AD web service.

 

expect i don't undestand how to do so, i've install the web service and it works fine, but i don't understand what i need to edit in order to have this validation in one of the pages

 

in UDI wizard.

 

 

help would be much appreciated, as i want to use this web service for other things as well in my UDI.

 

Thank you in advance.

Share this post


Link to post
Share on other sites


sounds like you'd have to edit a custom page to call a webservice if thats what you want to do,

which version of MDT are you using and what web services are you using ?

Share this post


Link to post
Share on other sites

I'm using MDT 2012 Update 1 (created a page using the CreateYourOwnPage option in the UDI Wizard) and i'm using the following Web service: kKoster.Deployment.Webservice_v7_3

 

I'm using the following script to check against the web service (which works):

 

'//----------------------------------------------------------------------------

On Error Resume Next

iRetVal = ZTIProcess

ProcessResults iRetVal

On Error Goto 0

'//---------------------------------------------------------------------------

'//

'// Function: ZTIProcess()

'//

'// Input: None

'//

'// Return: Success - 0

'// Failure - non-zero

'//

'// Purpose: Perform main ZTI processing

'//

'//---------------------------------------------------------------------------

Function ZTIProcess()

Dim oService, oXML, strMyServer, sResult

iRetVal = Success

oLogging.CreateEntry "DOES COMPUTER EXIST: Processing Does Computer Exist in AD routine", LogTypeInfo

 

' Create the web service instance

Set oService = New WebService

oService.iniFile = "customsettings.ini"

oService.SectionName = "DoesComputerExist"

 

strMyServer = oEnvironment.item("myServerName")

 

' Make the web service call

Set oXML = oService.Query

If oXML Is Nothing Then

oLogging.CreateEntry "Unable to call DoesComputerExist web service.", LogTypeWarning

MsgBox "Could not verify computer name against AD! Please contact your Administrator."

sResult = 0

Else

oXML.setProperty "SelectionNamespaces", "xmlns:mk='http://maikkoster.com/Deployment'"

If UCase(oXML.SelectSingleNode("mk:boolean").Text) = "TRUE" Then

oLogging.CreateEntry "Computer exists in Active Directory!", LogTypeInfo

MsgBox "Computer account already exists!! Please use the back arrow to return to the previous screen and make the necessary changes."

sResult = True

iRetVal = Success

Else

oLogging.CreateEntry "Computer does NOT exist in Active Directory!", LogTypeInfo

sResult = False

End If

End If

oEnvironment.item("strServerExists") = sResult

 

ZTIProcess = iRetVal

End Function

</script>

</job>

<!--b error="false" debug="false"-->

 

and also the following CustomSettings.ini settings:

 

[DoesComputerExist]

WebService=http://sms2012cen1/Webservice/AD.asmx/DoesComputerExist

Parameters=myServerName

myServerName=ComputerName

 

 

what i don't understand, is how to run the script in the backround after the user input the computer name in the field so it will give error or message if the computer account is not

present in the AD.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...