views:

95

answers:

0

I am trying to get the WindowsIdentity for the computer account the current user is logged into.

Currently I am using the following code to get the group membership of the current user:

WindowsIdentity currentIdent = WindowsIdentity.GetCurrent();
foreach (IdentityReference indentity in currentGroups)
{
  String groupName = indentity.Translate(typeof(NTAccount)).ToString();
}

This works fine, but I also need to do the same for the current computer account preferably without querying AD.

I beleive that I will have to do this using Impersonation but have not been able to find out how.