3

I am trying to setup auto VPN on Windows 10 laptop and created a Powershell scripted as suggested in https://learn.microsoft.com/en-us/windows-server/remote/remote-access/vpn/always-on-vpn/deploy/vpn-deploy-client-vpn-connections. I am using the same script to setup the VPN.

The profile creation works fine, but when I run the script again, deletion of the profile fails. I debugged the problem and found out that EnumerateInstances on MDM_VPNv2_01 class in root\cimv2\mdm\dmmap namespace is failing. It fails with following error string - "A general error occurred that is not covered by a more specific error code..".

On doing some more exploration, I found out that I need to execute following WMI query to get the instances of MDM_VPNv2_01 class, that too returns a Generic Failure (Please note I have a VPN adapter created on the laptop when I executed this query):

PS C:\> Get-WmiObject -Namespace root\cimv2\mdm\dmmap -Class MDM_VPNv2_01
Get-WmiObject : Generic failure
At line:1 char:1
+ Get-WmiObject -Namespace root\cimv2\mdm\dmmap -Class MDM_VPNv2_01
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

I tried several options like running this query in WMI-explorer, recompiling the MOF for this particular provider etc., but nothing helped. I ran WMIDiag on my machine which gives following message for the MDM_VPNv2_01 class:

.9847 17:26:21 (3)    1 static instance(s) found for '__SystemSecurity' in 'ROOT/CIMV2/MDM/DMMAP'in 0 second(s).
.9848 17:26:21 (3)    Retrieving static information (MOF) of 'MDM_VPNv2_01' (I=1).
.9849 17:26:21 (3)    Qualifier information of 'MDM_VPNv2_01': Dynamic=True, Provider='DMWmiBridgeProv', Association=False.
.9850 17:26:21 (3)    Dynamic 'MDM_VPNv2_01' class in 'ROOT/CIMV2/MDM/DMMAP' is supported by WMI provider 'DMWmiBridgeProv'.
.9851 17:26:21 (3)    Skipping request of dynamic instances of 'MDM_VPNv2_01' in 'ROOT/CIMV2/MDM/DMMAP' because:
.9852 17:26:21 (3)    - Request all dynamic instances is set to FALSE.

Please note that the same script works fine on other laptops. It is worth mentioning here that I am running this script with a local user account having administrator privileges.

I could not find any helpful information related to this problem on Internet. It would be really a great help if someone can suggest a possible solution for this problem.

I enabled WMI activity debug and observed following error log on running the query to get MDM_VPNv2_01 class instances:

Log Name:      Microsoft-Windows-WMI-Activity/Debug
Source:        Microsoft-Windows-WMI-Activity
Date:          20-09-2018 19:38:41
Event ID:      101
Task Category: None
Level:         Error
Keywords:      
User:          INCT-ARUN\akoshal
Computer:      INCT-Arun
Description:
ComponentName = WMI_ADAPTER; ErrorId = 0x1; ErrorDetail = WMIContext::PostResultToServer, provider completed the operation with context (00000211E4C517A0). Failed with MIRESULT (1).; FileName = onecore\admin\wmi\wmiv2\tools\adapter\wmicontext.cpp:945
Arun Kaushal
  • 593
  • 3
  • 16
  • I enabled WMI activity debug and observed following error log when I execute the query to get MDM_VPNv2_01 instances: – Arun Kaushal Sep 20 '18 at 14:31
  • Same issue. But I was able to run `Get-WmiObject -Namespace root\cimv2\mdm\dmmap -Class MDM_VPNv2_01` successfully after switching to a local administrator account. However, wasn't able to finish testing due to other VPN configuration issues – fjch1997 Dec 22 '18 at 06:52

0 Answers0