❔ CIM Class MDM_RemoteWipe Method Question

Hi friends, I am attempting to call a method using CimSession.InvokeMethod() called doWipeProtectedMethod. Microsoft does not seem to provide a lot of documentation on this, so I am confused about the parameters that are supposed to be used with it. Here's the Microsoft Doc and my current code: https://learn.microsoft.com/en-us/windows/win32/dmwmibridgeprov/mdm-remotewipe-dowipeprotectedmethod https://learn.microsoft.com/en-us/dotnet/api/microsoft.management.infrastructure.cimmethodparameter.create?view=powershellsdk-7.3.0
Microsoft.Management.Infrastructure.CimSession session = CimSession.Create("localhost");

var wipeMethodParamCollect = new CimMethodParametersCollection() {
Microsoft.Management.Infrastructure.CimMethodParameter.Create("param", "", Microsoft.Management.Infrastructure.CimType.String, CimFlags.In)
};

session.InvokeMethod("root\\cimv2\\mdm\\dmmap", "MDM_RemoteWipe", "doWipeProtectedMethod", wipeMethodParamCollect);
Microsoft.Management.Infrastructure.CimSession session = CimSession.Create("localhost");

var wipeMethodParamCollect = new CimMethodParametersCollection() {
Microsoft.Management.Infrastructure.CimMethodParameter.Create("param", "", Microsoft.Management.Infrastructure.CimType.String, CimFlags.In)
};

session.InvokeMethod("root\\cimv2\\mdm\\dmmap", "MDM_RemoteWipe", "doWipeProtectedMethod", wipeMethodParamCollect);
I am not understanding what to do with the "Object" parameter of the CimMethodParamater.Create() method. Also, if what I'm doing seems correct, then I don't understand why my session.InvokeMethod() fails. I get the following .NET application error:
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.Management.Infrastructure.CimException
   at Microsoft.Management.Infrastructure.Internal.Operations.CimSyncEnumeratorBase`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Linq.Enumerable.SingleOrDefault[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at Microsoft.Management.Infrastructure.CimSession.InvokeMethod(System.String, System.String, System.String, Microsoft.Management.Infrastructure.CimMethodParametersCollection, Microsoft.Management.Infrastructure.Options.CimOperationOptions)
 
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.Management.Infrastructure.CimException
   at Microsoft.Management.Infrastructure.Internal.Operations.CimSyncEnumeratorBase`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Linq.Enumerable.SingleOrDefault[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at Microsoft.Management.Infrastructure.CimSession.InvokeMethod(System.String, System.String, System.String, Microsoft.Management.Infrastructure.CimMethodParametersCollection, Microsoft.Management.Infrastructure.Options.CimOperationOptions)
 
doWipeProtectedMethod method of the MDM_RemoteWipe class - Win32 apps
Triggers the device to start the remote wipe on the device, and fully clean the internal drive. In some device configurations, this command might leave the device unable to boot.
CimMethodParameter.Create Method (Microsoft.Management.Infrastructure)
Learn more about the Microsoft.Management.Infrastructure.CimMethodParameter.Create in the Microsoft.Management.Infrastructure namespace.
3 Replies
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
XyberSchwifty
XyberSchwiftyOP2y ago
Bump
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server