From an Outlook macro, I want to run the quser command to get the logon datetime :
Private Sub getLogonDateTime()
MsgBox CreateObject("WScript.Shell").Exec("quser").StdOut.ReadAll()
End Sub
It works when I'm logged in as admin. When I'm not logged in as admin, I get a runtime error ("file not found").
But quser works in cmd or powershell even if I'm not admin.
Is it some kind of security setting ? How can I read quser result from outlook VBA if I'm not an admin ?