-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wecutil ss error x057 #26
Comments
I think this is a wecutil issue - not specific to any of the subscription xml files here; I ran into the same problems even when copying the examples verbatim from the MS docs (!). |
This is a known behavior when pushing for a subscription. The solution is just to remove or comment the line "SourceInitiated" in the XML file. Afterwards, pushing will work. |
In case someone else runs into the problem and wants to automate a fix, assuming you set # KNOWN ISSUE: https://support.microsoft.com/en-za/help/4491324/0x57-error-wecutil-command-update-event-forwarding-subscription
# Hack in extra logic to first read the config file as XML, then delete the SubscriptionType element/node and, write a new temp file, and then apply a version of that file without the element.
[xml]$x = Get-Content -Path $subscriptionConfigFile -ErrorAction Stop
# For whatever lack of care for usability, Microsoft C# / powershell seems to require explicit namespace definitions and won't apply XPath on the default namespace defined...
$ns = @{ns = 'http://schemas.microsoft.com/2006/03/windows/events/subscription'}
$nodeSubscriptionType = (Select-Xml -Xml $x -Namespace $ns -XPath '/ns:Subscription/ns:SubscriptionType' -ErrorAction Stop).Node
$x.SubscriptionType.RemoveChild($nodeSubscriptionType)
$subscriptionConfigFileNameProp = Get-Item $subscriptionConfigFile | Select-Object -Property FullName, DirectoryName, BaseName
$ssSubscriptionConfigFile = "$($subscriptionConfigFileNameProp.DirectoryName)/$($subscriptionConfigFileNameProp.BaseName).ss.xml"
$x.Save($ssSubscriptionConfigFile)
wecutil.exe set-subscription /c:$ssSubscriptionConfigFile
Remove-Item -Path $ssSubscriptionConfigFile
Write-Output "`"$subscription`" subcription overwritten" For me, I found the way C# / PowerShell deals with XML quite painful when it comes to handling the namespace.... |
@JPvRiel 's script is very helpful. I found that a small (and ignorable) exception is thrown when the Configuration mode for the subscription is not Custom (mine is MinLatency) - even if the node is removed. I also had to change This is the exception I'm choosing to ignore (actually multiple exceptions thrown, one per line?)
This is the script I used:
|
Hello, thank you for your base files, excellent.
After i update a subscription XML file, and try to update the subscription using
wecutil ss .\filename.xml
, i receive the following error.Failed to open subscription. Error = 0x57.
Any clues?
The text was updated successfully, but these errors were encountered: