Jump to content


Exodus

Established Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Exodus

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location
    Sweden
  1. Well, the web.config file remained unchanged during this time, and it doesn't explain why it would be possible to POST using PowerShell yet not with VBScript. The specific part of the web.config I believe you're referring to is: <add name="WSDL" path="*.wsdl" verb="GET,HEAD,POST,DEBUG" modules="ProtocolSupportModule" resourceType="Unspecified" /> As you can see, it allows for both POST and GET. It's odd, because you are right in that IIS 500 errors point us to the webservice - but maybe the VBScript added something to the "payload" (i.e. content) which the webservice couldn't handle?
  2. I'm not sure. All I know is that the VBScript fails, whilst the PowerShell script doesn't. It might be something in ZTIDataAccess.vbs (WebService class section). All I can tell that the call to the webservice doesn't work, but doing it the same way using PowerShell works fine - could there be a missing reference somewhere? If time permits, I'll try to recreate the issue and see if I can nail down the root cause.
  3. Finally got this to work! (It wasn't the boot wim that was the issue) I'll post it here if anyone else runs into the same issue, they can do the following: Replace the "Call ChangeComputerName webservice" step in the Task Sequence with the following:A Run Command Line step with the following: powershell.exe -ExecutionPolicy Bypass -file "%SCRIPTROOT%\wnb\GenerateComputerName.ps1" In the wnb folder (where the old "changecomputername.wsf" resides), create a new file named "GenerateComputerName.ps1". It should contain the following (change as you deem necessary): # Script to call WebService to change computername $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition $toolsPath = ($scriptPath | Split-Path | Split-Path) + "\Tools\Modules\ZTIUtility" Import-Module "$toolsPath\ZTIUtility.psm1" #$env:PSExecutionPolicyPreference = "Unrestricted" # Determine where to do the logging $TSENV = New-Object -COMObject Microsoft.SMS.TSENVironment $logPath = $TSENV:LogPath $logFile = "$logPath\GenerateComputerName.log" # Start the logging Start-Transcript $logFile Write-Output "Logging to $logFile" #Get TSENV stuff: $dnsDomain = $TSENV:dnsDomain $prefix = $TSENV:prefix $uuid = $TSENV:UUID # Load up the WebService, and call the function Try { $ADWebS = New-WebServiceProxy -Uri http://SCCMSERVER/risnaming/risnaming.asmx?WSDL $ComputerName = $ADWebS.GenerateName($dnsDomain, $prefix, $uuid) $TSENV:OSDCOMPUTERNAME = "$ComputerName" Write-Output "INFO: Set ComputerName to $ComputerName" } Catch { Write-Output "ERROR: $ErrorMessage" } Stop-Transcript Example; in my case, I also have variables for office and departments. I added the and modified the following: $dptValue = $TSENV:dptValue $officeValue = $TSENV:officeValue # Change $ComputerName = $ADWebS.GenerateName($dnsDomain, $prefix, $uuid) to: $ComputerName = $ADWebS.GenerateName($dnsDomain, $prefix, $uuid, $dptValue, $officeValue) Cheers!
  4. So, I decided to try a workaround, using PowerShell instead, as I think something is happening with how the VBScript calls the webservice. I got the PowerShell script to run successfully in the TS environment, but when triggering it through the TS it fails: So I decided to try to invoke the PowerShell command in a few different ways, but all of them fail. So neither package or calling the script through MDT works: The script itself isn't exactly rocket-science, but in this case it appears to be failing because it fails to start the PS host shell? # Script to call WebService to change computername Import-Module %scriptroot%\wnb\ZTIUtility.psm1 #$env:PSExecutionPolicyPreference = "Unrestricted" # Determine where to do the logging $TSENV = New-Object -COMObject Microsoft.SMS.TSENVironment $logPath = $TSENV:LogPath $logFile = "$logPath\GenerateComputerName.log" # Start the logging Start-Transcript $logFile Write-Output "Logging to $logFile" #Get TSENV stuff: $dnsDomain = $TSENV:dnsDomain $prefix = $TSENV:prefix $uuid = $TSENV:UUID $dptValue = $TSENV:dptValue $officeValue = $TSENV:officeValue # Load up the WebService, and call the function Try { $ADWebS = New-WebServiceProxy -Uri http://sesccm01/risnaming/risnaming.asmx?WSDL $ComputerName = $ADWebS.GenerateName($dnsDomain, $prefix, $uuid, $dptValue, $officeValue) $TSENV:OSDCOMPUTERNAME = "$ComputerName" Write-Output "INFO: Set ComputerName to $ComputerName" } Catch { Write-Output "ERROR: $ErrorMessage" } Stop-Transcript Ideas why the PowerShell would fail?
  5. Hi anyweb, Thanks for replying, really appreciate it! I think you may be onto something. In the webService, I had defined the input variables as "office" and "department" respectively, so my first idea was to change those from: [WebMethod] public String GenerateName(String dnsDomain, String prefix, String uuid, String department, String office) to [WebMethod] public String GenerateName(String dnsDomain, String prefix, String uuid, String dptValue, String officeValue) To match those that are configured in CustomSettings.ini: [ChangeComputerName] WebService=http://sesccm01/risnaming/risnaming.asmx?op=GenerateName Parameters=dnsDomain,prefix,uuid,dptValue,officeValue This didn't help, unfortunately. The Prefix is only acting up on the virtual machine (which is odd, the TS step is skipping because as IsVirtual is considered false). On the desktop, however, we can see all the values being pulled through: <![LOG['debug' parameter was specified.]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername"> <![LOG[Property debug is now = TRUE]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername"> <![LOG[Microsoft Deployment Toolkit version: 6.1.2373.0]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername"> <![LOG[The task sequencer log is located at X:\WINDOWS\TEMP\SMSTSLog\SMSTS.LOG. For task sequence failures, please consult this log.]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername"> <![LOG[Using specified INI file = C:\_SMSTaskSequence\WDPackage\CustomSettings.ini]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername"> <![LOG[CHECKING the [ChangeComputerName] section]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername"> <![LOG[About to execute web service call using method POST to http://sesccm01/risnaming/risnaming.asmx?op=GenerateName: dnsDomain=euse&prefix=DT&uuid=4C4C4544-0038-5810-8053-B2C04F563432&dptValue=DEV&officeValue=SE]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername"> <![LOG[Unexpected response from web service: 500 Internal Server Error <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="3" thread="" file="changecomputername"> <![LOG[Unable to call ChangeComputername WebService.]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="2" thread="" file="changecomputername"> It might be worth mentioning that the boot image I'm using is x64, although that shouldn't matter. We can clearly see that it's POSTing the correct values, yet it appears as if the VBScript can't invoke the WebService properly. EDIT: I noted the following in the IIS log, which shows us that it might be something with the WebService afterall: 172.16.20.12 POST /risnaming/risnaming.asmx op=GenerateName 80 - 172.16.7.138 Mozilla/4.0+(compatible;+Win32;+WinHttp.WinHttpRequest.5) - 500 0 0 759 53 I'm digging through the error codes and hopefully I can nail down the issue. Any other ideas?
  6. Hi, First off, I'd like to thank and commend you for creating such a great tool I'm getting desperate now as I'm so close to having this implemented at my workplace. As we are looking to name our computers according to a number of parameters (specifically depending on the office location and the department), I decided to extend Niehaus' RIS Naming webservice. In short I simply modified it to take two new parameters, department and office. The WebService by itself works absolutely fine, i.e. triggering through a SOAP action (e.g. .NET WEbService Studio) or directly from a browser, it returns a correct value: As you can see, the actual webservice appears to be working correctly. However, when I try to connect it using the mdt scripts, with the following settings, I get a 500 Internal error response: [ChangeComputerName] WebService=http://sesccm01/risnaming/risnaming.asmx?op=GenerateName Parameters=dnsDomain,prefix,uuid,dptValue,officeValue <![LOG[CHECKING the [ChangeComputerName] section]LOG]!><time="14:45:25.000+000" date="03-06-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername"> <![LOG[No value specified for parameter 'PREFIX', web service results could be unpredictable.]LOG]!><time="14:45:25.000+000" date="03-06-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername"> <![LOG[Unexpected response from web service: 500 Internal Server Error <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>]LOG]!><time="14:45:25.000+000" date="03-06-2015" component="changecomputername" context="" type="3" thread="" file="changecomputername"> <![LOG[Unable to call ChangeComputername WebService.]LOG]!><time="14:45:25.000+000" date="03-06-2015" component="changecomputername" context="" type="2" thread="" file="changecomputername"> The above is from a virtual machine. this is what I get from a desktop: <![LOG[CHECKING the [ChangeComputerName] section]LOG]!><time="14:39:32.000+000" date="03-06-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername"> <![LOG[Unexpected response from web service: 500 Internal Server Error <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>]LOG]!><time="14:39:32.000+000" date="03-06-2015" component="changecomputername" context="" type="3" thread="" file="changecomputername"> <![LOG[Unable to call ChangeComputername WebService.]LOG]!><time="14:39:32.000+000" date="03-06-2015" component="changecomputername" context="" type="2" thread="" file="changecomputername"> The Prefix, interestingly enough, should be set during the TS (this is unchanged from when I imported it), but since we're seeing the 500 error regardless I doubt it's the problem: (Options > Conditions is still set to e.g. IsDesktop equals "True") I've added dptValue and officeValue info gathering to the HTA, and the values are populated, e.g: dptValue = dptDrop.options[dptDrop.selectedIndex].value; officeValue = offDrop.options[offDrop.selectedIndex].value; Can anyone help me figure out what is going wrong? (I should probably mention that I also added some logging functionality to the WebService, should it fail for some reason e.g. exceptions, but nothing is logged)
×
×
  • Create New...