Getting NULL value from 'Win32_LogonSession' through WMI [modified]
-
Mark :))))))))))))))))))))))))))) U are genious ! I am getting the name now :))thank you so much!!!!!!! Have a gr8 day ahead ! Best Regards, Supriya Tonape.
You're welcome. You have a great day as well! :) Cheers, Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Mark :))))))))))))))))))))))))))) U are genious ! I am getting the name now :))thank you so much!!!!!!! Have a gr8 day ahead ! Best Regards, Supriya Tonape.
I am still wondering what exact mistake i was doing, all flags were set properly.. let me check in detail so I wont make it in future. Thx so much again. ! :) Regards, Supriya Tonape.
-
Mark :))))))))))))))))))))))))))) U are genious ! I am getting the name now :))thank you so much!!!!!!! Have a gr8 day ahead ! Best Regards, Supriya Tonape.
Also, if you remove the "WHERE LogonType = 2 OR LogonType = 10" from the outer query, you can see all logon sessions, not just the interactive ones. :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Also, if you remove the "WHERE LogonType = 2 OR LogonType = 10" from the outer query, you can see all logon sessions, not just the interactive ones. :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
yup Mark. You really made my day :) U have gr8 weekend ahead! Best Regards, Supriya.
-
yup Mark. You really made my day :) U have gr8 weekend ahead! Best Regards, Supriya.
Supriya Tonape wrote:
U have gr8 weekend ahead!
Thank you....you too!
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Supriya Tonape wrote:
U have gr8 weekend ahead!
Thank you....you too!
Mark Salsbery Microsoft MVP - Visual C++ :java:
Also in this code though I have kept 'logontype' as 2 and 10 to get only active user names, but it;s returning me all users those are Disc earlier...
-
Also in this code though I have kept 'logontype' as 2 and 10 to get only active user names, but it;s returning me all users those are Disc earlier...
Supriya Tonape wrote:
but it;s returning me all users those are Disc earlier..
Which means what? :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Supriya Tonape wrote:
but it;s returning me all users those are Disc earlier..
Which means what? :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
:) actually i will check it.. I just need usernames who has active session.
-
:) actually i will check it.. I just need usernames who has active session.
Hi Mark, I just realized that 2nd query which forms like "Associators of {Win32_LogonSession.LogonId=1121214} Where AssocClass=Win32_LoggedOnUser Role=Dependent" works for local machine but when I try to execute it on remote machine after above query executes, at next line it fails... Query execution passes but enumeration fails.. at below line, HRESULT hr1 = pEnumerator1->Next(WBEM_INFINITE, 1, &pclsObj1, &uReturn1); I have been trying different things to check out but no luck, any idea why it cud be happening or is there any change in query while running on remote machine ? Regards, Supriya Tonape
-
Hi Mark, I just realized that 2nd query which forms like "Associators of {Win32_LogonSession.LogonId=1121214} Where AssocClass=Win32_LoggedOnUser Role=Dependent" works for local machine but when I try to execute it on remote machine after above query executes, at next line it fails... Query execution passes but enumeration fails.. at below line, HRESULT hr1 = pEnumerator1->Next(WBEM_INFINITE, 1, &pclsObj1, &uReturn1); I have been trying different things to check out but no luck, any idea why it cud be happening or is there any change in query while running on remote machine ? Regards, Supriya Tonape
Hi All, For some reason, when I add the following lines, to get the StartTime property value, the get function fails. Any ideas?
VARIANT vtProp2;
HRESULT hr2 = pclsObj1->Get(L"StartTime", 0, &vtProp2, 0, 0);
if(hr1 == S_OK)
{
SYSTEMTIME t;
int res = VariantTimeToSystemTime(vtProp2.dblVal, &t);
}