Differentiate between access denied & login failure


i have monitoring component monitors every windows objects in network. using wmi & powershell purpose. extracting connection exceptions identify kind of exceptions coming each object. example...

if (exceptionmessage.tolower().contains("access denied."))  {      // returns access denied  }  else if (exceptionmessage.tolower().contains("the rpc server unavailable."))  {      // returns host unavailable  }  else if (exceptionmessage.tolower().contains("this operation create incorrectly structured document."))  {      // returns exception  }  else  {      // returns login failure  }

but in cases, if give invalid credentials, getting "access denied", not "login failed".

can explain why happening. how can differentiate between "access denied" , "login failed".

helpful information on appreciated.

sebastian

hi sebastian,

first want script above more related c#, however, scripts , applications access wmi namespaces , data fall 3 categories:

1.  0x80070005 dcom access denied: username/password not exist.
2.  0x800706ba rpc server unavailable
3.  0x080041003 wmi access denied

for more detailed information, please go through article:

let’s troubleshoot wmi (part 1: remoting , security)

if have feedback on our support, please click here.

best regards,

anna wang

technet community support



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS