How to get uptodate user information with WindowsIdentity object?

I have the folling codes in C#

WindowsIdentity user = WindowsIdentity.GetCurrent();

IdentityReferenceCollection groups = user.Groups.Translate(typeof(NTAccount));

Everything works fine. However, whenever I change something in ActiveDirectory for a user, the user must logoff and log back in to see the changes. Are there anywany for me to force WindowsIdentity object to get the uptodated Groups without logoff and logback in

Regards,

JDang



Answer this question

How to get uptodate user information with WindowsIdentity object?

  • Stuman99

    Doubt it.



  • Bigmo

    Until at this point, the user must logoff and login again to see the changes. You can call GetCurrent() many times but the Groups remain static. Do you think this is a bug

    Regards,

    Jdang


  • Emy_P

    Does it perhaps update when you call GetCurrent() again (I haven't tried)


  • How to get uptodate user information with WindowsIdentity object?