Antivirus para windows server

broken image

Hr = pWbemServices->ExecQuery(CComBSTR('WQL'), cbsQuery, WBEM_FLAG_FORWARD_ONLY, NULL, &pEnum) ĬsLog.AppendFormat('ExecQuery failed,Error= %ld,Retrun code= 0x%X',dwErr,hr) Hr = pWbemLocator->ConnectServer(CComBSTR(L'root\\Securit圜enter2'), NULL, NULL, 0, NULL, 0, NULL, &pWbemServices) ĬComBSTR cbsQuery = L'Select * From AntiVirusProduct'

broken image

Hr = pWbemLocator.CoCreateInstance(CLSID_WbemLocator) Hr = ::CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL) So kindly help us to solve this problem.Here is the code we are using: void GetAntiVirusDetails() And the code works fine for Windows 7, 8.1, 10, but it failed on Windows Server 2016 OS. We are using WMI services for retrieving AntiVirus details (name of AntiVirus and installed status) from Windows.