I supposed this request applies to any task executed through SPML request. I am looking to provide our help desk an easy way to mass delete workstations matching a specific stale/idle day range.
Until an API is ready for primetime, I'm testing spml delete operation through simple PowerShell request.
This works - but I'd like to provide the ability to apply a reason code to these SPML operations ... 'Delete at 120+ days stale', 90+ etc ..
Where do you specify the reason code in an SPML delete request so the value appears in the 'User Activity' section of the initiator's change history / or get-qarsoperation lookups.
$spmlhost = 'My ARS SPML Server' $object = 'full DN of the object to delete' $CLASS = "Active_x0020_Roles_x0020_SPML_x0020_" $ARSOAP = New-WebServiceProxy -Uri "https://$($spmlhost)/ARServerSPML/SPMLProvider.asmx" -usedefaultcredential -Class $CLASS -erroraction stop $ARSOAP.PreAuthenticate = $true $Type = $ARSOAP.GetType().Namespace $deleteRequest = New-Object -TypeName ($type + ".CdeleteRequest") #$deleteRequest.returndata="everything" $CPSOID = New-Object -TypeName ($Type + ".CPSOID") $CPSOID.ID = $object $deleteRequest.psoID = $CPSOID $ARSOAP.delete($deleteRequest)