Recently I was setting up Maik Kosters OS Deployment Web Services for a customer and I need to test them, sure, you can do that interactively directly by running them, but I wanted the “PowerShell” way to do it.
You can get the Web Services from Maik Koster here: http://mdtcustomizations.codeplex.com/documentation?referringTitle=Home
Testing a Web Services the Non PowerShell Way.
Testing a Web Services the PowerShell Way.
Since PowerShell has the function built-in it is very much a no-brainer.
To connect and get all members from the Web Services execute this:
$ADWebS = New-WebServiceProxy -Uri http://MDT01/OSD/ad.asmx?WSDL $ADWebS | Get-Member -Type Method
That will give you something like this back
To connect and get one member with some detail execute this:
$ADWebS = New-WebServiceProxy -Uri http://MDT01/OSD/ad.asmx?WSDL $ADWebS | Get-Member -Name DoesComputerExist -Type Method | Format-List
That will give you something like this back
So, to test the DoesComputerExists with a value you can now execute the following:
$CompuerNameToTest = "MDT01" $ADWebS = New-WebServiceProxy -Uri http://MDT01/OSD/ad.asmx?WSDL $ComputerExistsInAd = $ADWebS.DoesComputerExist("$CompuerNameToTest") Write-Host "The Computer $CompuerNameToTest exists in Active Directory: $ComputerExistsInAd"
So if the Computer Exists in Active Directory you should get something like this back
/mike
Categories: Lite Touch, MDT, OS Deployment, Zero Touch