I have still been unable to get this to work. My complete code is below if you can assist.
$product = Get-WmiObject -Namespace root\wmi -class ms_systeminformation | Select -ExpandProperty SystemSKU
$Serial = Get-WmiObject win32_bios | Select-Object -ExpandProperty SerialNumber
$reqRegNs = @{
‘SOAP-ENV’ = ‘http://schemas.xmlsoap.org/soap/envelope/’
‘iseeReg’ = ‘http://www.hp.com/isee/webservices/’
‘isee’ = ‘http://www.hp.com/schemas/isee/5.00/event’
}
$reqWarNs = @{
‘SOAP-ENV’ = ‘http://schemas.xmlsoap.org/soap/envelope/’
‘iseeReg’ = ‘http://www.hp.com/isee/webservices/’
‘isee’ = ‘http://www.hp.com/isee/webservices/’
}
$reqWarEntNs = @{
‘SOAP-ENV’ = ‘http://schemas.xmlsoap.org/soap/envelope/’
‘isee’ = ‘http://www.hp.com/schemas/isee/5.00/entitlement’
}
$resNs = @{
‘soap’ = ‘http://schemas.xmlsoap.org/soap/envelope/’
‘isee’ = ‘http://www.hp.com/isee/webservices/’
}
function IseeRequest([string]$service, [string]$action, [xml]$body)
{
$res = Invoke-WebRequest -UseBasicParsing
-Method Post -ContentType 'text/xml; charset=utf-8'
-Uri “https://services.isee.hp.com/$($service)/$($service)Service.asmx” -Headers @{'SOAPAction' = "http://www.hp.com/isee/webservices/$($action)"}
-UserAgent ‘RemoteSupport/A.05.05 - gSOAP/2.7’ `
-Body $body.OuterXml
[xml]$doc = $res.Content
$isSuccess = ($doc | Select-Xml -Namespace $resNs "//soap:Envelope/soap:Body/isee:$($action)Response/isee:$($action)Result/isee:IsSuccess").Node.InnerText -as [bool]
if (!$isSuccess) {
$doc.OuterXml
$err = ($doc | Select-Xml -Namespace $resNs "//soap:Envelope/soap:Body/isee:$($action)Response/isee:$($action)Result/isee:Error").Node.InnerText
Write-Error "ISEE request failed: $($err)"
Exit
}
return $doc
}
Register session
$curTime = Get-Date -Date (Get-Date).ToUniversalTime() -UFormat ‘%Y/%m/%d %H:%M:%S GMT’
#[xml]$regEnv = Get-Content ‘templates\register_soapenv.xml’
[xml]$regEnv = '<SOAP-ENV:Envelope
xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:iseeReg=“http://www.hp.com/isee/webservices/”>
<SOAP-ENV:Body>
<iseeReg:RegisterClient2>
<iseeReg:request/>
</iseeReg:RegisterClient2>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
’
#[xml]$regReq = Get-Content ‘templates\register_payload.xml’
[xml]$regReq = '<isee:ISEE-Registration schemaVersion=“5.00”
xmlns:isee=“http://www.hp.com/schemas/isee/5.00/event”>
<RegistrationSource>
<HP_OOSIdentifiers>
<OSID>
<Section name=“SYSTEM_IDENTIFIERS”>
<Property name=“TimestampGenerated”/>
</Section>
</OSID>
<CSID>
<Section name=“SYSTEM_IDENTIFIERS”>
<Property name=“CollectorType” value=“MC3”/>
<Property name=“CollectorVersion” value=“T05.80.1 build 1”/>
<Property name=“AutoDetectedSystemSerialNumber” value=“10”/>
<Property name=“SystemModel” value=“HP ProLiant”/>
<Property name=“TimestampGenerated”/>
</Section>
</CSID>
</HP_OOSIdentifiers>
<PRS_Address>
<AddressType>0</AddressType>
<Address1/>
<Address2/>
<Address3/>
<Address4/>
<City/>
<Region/>
<PostalCode/>
<TimeZone/>
<Country/>
</PRS_Address>
</RegistrationSource>
<HP_ISEECustomer>
<Business/>
<Name/>
</HP_ISEECustomer>
<HP_ISEEPerson>
<CommunicationMode>255</CommunicationMode>
<ContactType/>
<FirstName/>
<LastName/>
<Salutation/>
<Title/>
<EmailAddress/>
<TelephoneNumber/>
<PreferredLanguage/>
<Availability/>
</HP_ISEEPerson>
</isee:ISEE-Registration>
’
#[xml]$regEnv = Get-Content ‘templates\register_soapenv.xml’
#[xml]$regReq = Get-Content ‘templates\register_payload.xml’
Payload parameters
($regReq | Select-Xml -Namespace $reqRegNs ‘//isee:ISEE-Registration/RegistrationSource/HP_OOSIdentifiers/OSID/Section/Property[@name=“TimestampGenerated”]’).Node.SetAttribute(‘value’, $curTime)
($regReq | Select-Xml -Namespace $reqRegNs ‘//isee:ISEE-Registration/RegistrationSource/HP_OOSIdentifiers/CSID/Section/Property[@name=“TimestampGenerated”]’).Node.SetAttribute(‘value’, $curTime)
Envelope payload
($regEnv | Select-Xml -Namespace $reqRegNs ‘//SOAP-ENV:Envelope/SOAP-ENV:Body/iseeReg:RegisterClient2/iseeReg:request’).Node.InnerXml = $regEnv.CreateCDataSection($regReq.OuterXml).OuterXml
Write-Host ‘Registrating session…’
[xml]$regRes = IseeRequest ‘ClientRegistration’ ‘RegisterClient2’ $regEnv
$gdid = ($regRes | Select-Xml -Namespace $resNs ‘//soap:Envelope/soap:Body/isee:RegisterClient2Response/isee:RegisterClient2Result/isee:Gdid’).Node.InnerText
$token = ($regRes | Select-Xml -Namespace $resNs ‘//soap:Envelope/soap:Body/isee:RegisterClient2Response/isee:RegisterClient2Result/isee:RegistrationToken’).Node.InnerText
Write-Host “Got session id $($gdid)”
Warranty lookup
[xml]$warEnv = '<SOAP-ENV:Envelope
xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:isee=“http://www.hp.com/isee/webservices/”>
<SOAP-ENV:Header>
<isee:IseeWebServicesHeader>
<isee:GDID/>
<isee:registrationToken/>
<isee:OSID/>
<isee:CSID/>
</isee:IseeWebServicesHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<isee:GetOOSEntitlementList2>
<isee:request/>
</isee:GetOOSEntitlementList2>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
’
[xml]$warReq = '<isee:ISEE-GetOOSEntitlementInfoRequest
xmlns:isee=“http://www.hp.com/schemas/isee/5.00/entitlement”
schemaVersion=“5.00”>
<HP_ISEEEntitlementParameters>
<CountryCode/>
<SerialNumber/>
<ProductNumber/>
<EntitlementType/>
<EntitlementId/>
<ObligationId/>
</HP_ISEEEntitlementParameters>
</isee:ISEE-GetOOSEntitlementInfoRequest>
’
#[xml]$warEnv = Get-Content ‘templates\warranty_soapenv.xml’
#[xml]$warReq = Get-Content ‘templates\warranty_payload.xml’
Payload parameters
($warReq | Select-Xml -Namespace $reqWarEntNs ‘//isee:ISEE-GetOOSEntitlementInfoRequest/HP_ISEEEntitlementParameters/CountryCode’).Node.InnerText = $country
($warReq | Select-Xml -Namespace $reqWarEntNs ‘//isee:ISEE-GetOOSEntitlementInfoRequest/HP_ISEEEntitlementParameters/SerialNumber’).Node.InnerText = $serial
($warReq | Select-Xml -Namespace $reqWarEntNs ‘//isee:ISEE-GetOOSEntitlementInfoRequest/HP_ISEEEntitlementParameters/ProductNumber’).Node.InnerText = $product
Envelope headers and payload
($warEnv | Select-Xml -Namespace $reqWarNs ‘//SOAP-ENV:Envelope/SOAP-ENV:Header/isee:IseeWebServicesHeader/isee:GDID’).Node.InnerText = $gdid
($warEnv | Select-Xml -Namespace $reqWarNs ‘//SOAP-ENV:Envelope/SOAP-ENV:Header/isee:IseeWebServicesHeader/isee:registrationToken’).Node.InnerText = $token
($warEnv | Select-Xml -Namespace $reqWarNs ‘//SOAP-ENV:Envelope/SOAP-ENV:Body/isee:GetOOSEntitlementList2/isee:request’).Node.InnerXml = $warEnv.CreateCDataSection($warReq.OuterXml).OuterXml
Write-Host ‘Requesting warranty…’
[xml]$warRes = IseeRequest ‘EntitlementCheck’ ‘GetOOSEntitlementList2’ $warEnv
Write-Host ‘Dumping warranty payload:’
$warxml = ($warRes | Select-Xml -Namespace $resNs ‘//soap:Envelope/soap:Body/isee:GetOOSEntitlementList2Response/isee:GetOOSEntitlementList2Result/isee:Response’).Node.InnerText
$warxml = (($warxml.Substring($warxml.IndexOf(‘<EndDate>’),19)))
$warxml = $Warxml.Trim(‘<EndDate>’)
$props = @{
‘Warranty Expires:’ = $warxml;
‘Serial No:’ = $Serial;
‘Product Code’ = $Product;
‘Country Code’ = $Country
}