Check User's Credentials When Offline RRS feed

  • Question

  • I have an application that may be run in scenarios where no network access exists. The application has a feature that requires verification of the current user's Windows credentials. These credentials may be a local machine account, or an Active Directory account.

     I have code wrotten that uses the PrincipalContext class in System.DirectoryServices.AccountManagement that works great for both scenarios, but if the user's machine doesn't have a network connection, and I'm attempting to verify domain credentials, they get a PrincipalServerDownException.

    I know that Windows caches credentials so that you can log into a machine with a domain account even if your not on the domain network. Is there a way to tap into this cache so I can verifying credentials using the same offline cache?


    Friday, August 13, 2010 9:13 PM


  • I ended up using the LogonUser Win32 API, which seems to work perfectly.
    • Marked as answer by RMD Friday, August 13, 2010 9:56 PM
    Friday, August 13, 2010 9:56 PM