Get Windows Groups from WindowsIdentity

Here is a simple way to enumerate the Windows Groups associated with a WindowsIdentity:
 
        public static List<string> GetWindowsGroups(WindowsIdentity id)
        {
            List<string> groups = new List<string>();
            IdentityReferenceCollection irc = id.Groups;
           
            foreach ( IdentityReference ir in irc )
            {
                NTAccount acc = (NTAccount)ir.Translate(typeof(NTAccount));
                groups.Add(acc.Value);
            }
            return groups;
        }
 
–William
Advertisements
This entry was posted in C#. Bookmark the permalink.

6 Responses to Get Windows Groups from WindowsIdentity

  1. Unknown says:

    http://www.batteryfast.com/acer/as07b31.htm Acer as07b31 Battery http://www.batteryfast.com/acer/as07b41.htm Acer as07b41 Battery http://www.batteryfast.com/acer/as07b42.htm Acer as07b42 Battery http://www.batteryfast.com/acer/as07b51.htm Acer as07b51 Battery http://www.batteryfast.com laptop battery http://www.batteryfast.com laptop batteries http://www.batteryfast.com/dell/ dell laptop battery http://www.batteryfast.com/dell/inspiron-1520.htm Dell inspiron 1520 Battery http://www.batteryfast.com/dell/inspiron-6400.htm Dell inspiron 6400 Battery http://www.batteryfast.com/dell/ dell laptop batteries http://www.batteryfast.com/hp/ hp laptop battery http://www.batteryfast.com/hp/ hp laptop batteries http://www.batteryfast.com/dell/ dell laptop battery http://www.batteryfast.com/dell/ dell laptop batteries http://www.batteryfast.com/acer/aspire-5520.htm Acer aspire 5520 Battery http://www.batteryfast.com/acer/aspire-5920.htm Acer aspire 5920 Battery http://www.batteryfast.com/acer/batbl50l6.htm Acer batbl50l6 Battery http://www.batteryfast.com/sony/vgp-bps2.htm Sony vgp-bps2 Battery http://www.batteryfast.com/sony/vgp-bps2a.htm Sony vgp-bps2a Battery http://www.batteryfast.com/sony/vgp-bps2b.htm Sony vgp-bps2b Battery http://www.batteryfast.com/sony/vgp-bps2c.htm Sony vgp-bps2c Battery http://www.batteryfast.com/dell/6400.htm Dell 6400 Battery http://www.batteryfast.com/dell/d620.htm Dell d620 Battery http://www.batteryfast.com/dell/d630.htm Dell d630 Battery http://www.batteryfast.com/dell/d820.htm Dell d820 Battery http://www.batteryfast.com/dell/d830.htm Dell d830 Battery http://www.batteryfast.com/dell/e1505.htm Dell e1505 Battery http://www.batteryfast.com/dell/gd761.htm Dell gd761 Battery http://www.batteryfast.com/dell/gk479.htm Dell gk479 Battery http://www.batteryfast.com/dell/inspiron-1520.htm Dell inspiron 1520 Battery http://www.batteryfast.com/dell/inspiron-6400.htm Dell inspiron 6400 Battery http://www.batteryfast.com/acer/travelmate-4200-series.htm Acer travelmate 4200 series Battery http://www.batteryfast.com/acer/travelmate-4203-series.htm Acer travelmate 4203 series Battery http://www.batteryfast.com/acer/travelmate-4230-series.htm Acer travelmate 4230 series Battery http://www.batteryfast.com/apple/a1185-white.htm Apple a1185 white Battery http://www.batteryfast.com/asus/a32-f3.htm Asus a32-f3 Battery http://www.batteryfast.com/gateway/btp-68b3.htm Gateway btp-68b3 Battery http://www.batteryfast.com/gateway/squ-412.htm Gateway squ-412 Battery http://www.batteryfast.com/dell/vostro-1000.htm Dell vostro 1000 Battery http://www.batteryfast.com/dell/vostro-1500.htm Dell vostro 1500 Battery http://www.batteryfast.com/dell/wr050.htm Dell wr050 Battery http://www.batteryfast.com/dell/xps-m1210.htm Dell xps m1210 Battery http://www.batteryfast.com/dell/xps-m1330.htm Dell xps m1330 Battery http://www.batteryfast.com/dell/pu563.htm Dell pu563 Battery http://www.batteryfast.com/hp/530.htm Hp 530 Battery http://www.batteryfast.com/hp/dv2000.htm Hp dv2000 Battery

  2. Unknown says:

    http://www.batteryfast.com.au/asus/a32-f3.htm Asus a32-f3 Batteryhttp://www.batteryfast.com.au/asus/f3.htm Asus f3 Batteryhttp://www.batteryfast.com.au/toshiba/pa3285u-3bas.htm Toshiba pa3285u-3bas Batteryhttp://www.batteryfast.com.au/toshiba/pa3285u-3brs.htm Toshiba pa3285u-3brs Batteryhttp://www.batteryfast.com.au/dell/1501.htm Dell 1501 Batteryhttp://www.batteryfast.com.au/dell/6400.htm Dell 6400 Batteryhttp://www.batteryfast.com.au/dell/d620.htm Dell d620 Batteryhttp://www.batteryfast.com.au/dell/d630.htm Dell d630 Batteryhttp://www.batteryfast.com.au/dell/d820.htm Dell d820 Batteryhttp://www.batteryfast.com.au/dell/d830.htm Dell d830 Batteryhttp://www.batteryfast.com.au/dell/inspiron-1520.htm Dell inspiron 1520 Batteryhttp://www.batteryfast.com.au/dell/inspiron-1720.htm Dell inspiron 1720 Batteryhttp://www.batteryfast.com.au/hp/nc6000.htm Hp nc6000 Batteryhttp://www.batteryfast.com.au/hp/nc6100.htm Hp nc6100 Batteryhttp://www.batteryfast.com.au/hp/nc6120.htm Hp nc6120 Batteryhttp://www.batteryfast.com.au/hp/nc6120.htm Hp nc6200 Batteryhttp://www.batteryfast.com.au/hp/nc6400.htm Hp nc6400 Batteryhttp://www.batteryfast.com.au/hp/nc8230.htm Hp nc8230 Batteryhttp://www.batteryfast.com.au/hp/nx6100.htm Hp nx6100 Batteryhttp://www.batteryfast.com.au/hp/nx6120.htm Hp nx6120 Batteryhttp://www.batteryfast.com.au/hp/pavilion-dv2000.htm Hp pavilion dv2000 Batteryhttp://www.batteryfast.com.au/hp/pavilion-dv6000.htm Hp pavilion dv6000 Batteryhttp://www.batteryfast.com.au/dell/inspiron-6400.htm Dell inspiron 6400 Batteryhttp://www.batteryfast.com.au/dell/kd476.htm Dell kd476 Batteryhttp://www.batteryfast.com.au/dell/kr-onx511.htm Dell kr-onx511 Batteryhttp://www.batteryfast.com.au/dell/latitude-d620.htm Dell latitude d620 Batteryhttp://www.batteryfast.com.au/dell/latitude-d630.htm Dell latitude d630 Batteryhttp://www.batteryfast.com.au/dell/latitude-d810.htm Dell latitude d810 Batteryhttp://www.batteryfast.com.au/dell/latitude-d820.htm Dell latitude d820 Batteryhttp://www.batteryfast.com.au/dell/latitude-d830.htm Dell latitude d830 Batteryhttp://www.batteryfast.com.au/dell/vostro-1500.htm Dell vostro 1500 Batteryhttp://www.batteryfast.com.au/dell/vostro-1700.htm Dell vostro 1700 Batteryhttp://www.batteryfast.com.au/toshiba/pa3285u-1bas.htm Toshiba pa3285u-1bas Batteryhttp://www.batteryfast.com.au/toshiba/pa3285u-1brs.htm Toshiba pa3285u-1brs Batteryhttp://www.batteryfast.com.au/sony/vgp-bps2b.htm Sony vgp-bps2b Batteryhttp://www.batteryfast.com.au/sony/vgp-bps5a.htm Sony vgp-bps5a Batteryhttp://www.batteryfast.com.au/toshiba/pa3356u.htm Toshiba pa3356u Batteryhttp://www.batteryfast.com.au/toshiba/pa3356u-3bas.htm Toshiba pa3356u-3bas Batteryhttp://www.batteryfast.com.au/toshiba/pa3399u-1bas.htm Toshiba pa3399u-1bas Batteryhttp://www.batteryfast.com.au/toshiba/pa3399u-1brs.htm Toshiba pa3399u-1brs Batteryhttp://www.batteryfast.com.au/toshiba/pa3399u-2bas.htm Toshiba pa3399u-2bas Batteryhttp://www.batteryfast.com.au/toshiba/pa3451u-1brs.htm Toshiba pa3451u-1brs Batteryhttp://www.batteryfast.com.au/apple/a1175.htm Apple a1175 Batteryhttp://www.batteryfast.com.au/acer/as07b41.htm Acer as07b41 Batteryhttp://www.batteryfast.com.au/acer/aspire-5500.htm Acer aspire 5500 Battery

  3. Unknown says:

    http://www.batterylaptoppower.com/toshiba/pa3285u-3bas.htm Toshiba pa3285u-3bas Battery http://www.batterylaptoppower.com/toshiba/pa3395u-1brs.htm Toshiba pa3395u-1brs Battery http://www.batterylaptoppower.com/toshiba/pa3399u-1bas.htm Toshiba pa3399u-1bas Battery http://www.batterylaptoppower.com/toshiba/pa3399u-1brs.htm Toshiba pa3399u-1brs Battery http://www.batterylaptoppower.com/toshiba/pa3399u-2bas.htm Toshiba pa3399u-2bas Battery http://www.batterylaptoppower.com/toshiba/pa3399u-2brs.htm Toshiba pa3399u-2brs Battery http://www.batterylaptoppower.com/toshiba/pa3465u-1brs.htm Toshiba pa3465u-1brs Battery http://www.batterylaptoppower.com/toshiba/pa3534u-1brs.htm Toshiba pa3534u-1brs Battery http://www.batterylaptoppower.com/laptop-ac-adapter/acer/acer-19V-3.42A-65w-5.5mm-1.5mm-small-head.php Acer 1600 1680 19V 3.42A 65W 5.5MM*1.7MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/acer/acer-19V-3.42A-65w-5.5mm-2.5mm-big-head.php Acer 1600 1680 19V 3.42A 65W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/toshiba/toshiba-15V-5A-75w-6.3mm-3.0mm.php Toshiba PA3283U-1ACA 15V 5A 75W 6.3MM*3.0MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/toshiba/toshiba-19V-3.42A-65w-5.5mm-2.5mm.php Toshiba PA3467U PA3396U 19V 3.42A 65W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/toshiba/toshiba-19V-4.74A-90w-5.5mm-2.5mm.php Toshiba PA3589U 19V 4.74A 90W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/asus/asus-19v-3.42A-65w-5.5mm-2.5mm.php Asus A2 A3 19V 3.42A 65W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/dell/dell-19.5V-3.34A-65w-7.4mm-5.0mm-with-pin-pa-12.php Dell 6400 D620 19.5V 3.34A 65W 7.4MM*5.0MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/toshiba/toshiba-15V-6A-90w-6.3mm-3.0mm.php Toshiba PA2521U PA3201U-1ACA 15V 6A 90W 6.3MM*3.0MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/toshiba/toshiba-15V-3A-45w-6.3mm-3.0mm.php Toshiba PA2450U PA3241U-1ACA 15V 3A 45W 6.3MM*3.0MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/samsung/samsung-19V-3.16A-60w-5.5mm-3.4mm-pin-inside.php Samsung GT8000 GT8600 19V 3.16A 60W 5.5MM*3.4MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/delta/delta-19V-3.42A-65w-5.5mm-2.5mm.php Delta 1680 19V 3.42A 65W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/hp/hp-18.5V-3.5A-65w-4.8mm-1.7mm.php Hp DV2000 DV6000 DV1000 18.5V 3.5A 65W 4.8MM*1.7MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/hp/hp-18.5V-4.9A-90w-5.5mm-2.5mm.php Hp ZT1000 XT1000 18.5V 4.9A 90W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/hp/hp-19V-4.74A-90w-4.8mm-1.7mm.php Hp NC6000 NC8230 19V 4.74A 90W 4.8MM*1.7MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/hp/hp-19V-4.74A-90w-5.5mm-2.5mm.php Hp DV9000 19V 4.74A 90W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/liteon/liteon-19V-3.42A-65w-5.5mm-2.5mm-white.php Liteon M320 M680 19V 3.42A 65W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/liteon/liteon-19V-3.95A-75w-5.5mm-2.5mm.php Liteon 1200 1800 19V 3.95A 75W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/liteon/liteon-19V-4.74A-90w-5.5mm-1.7mm.php Liteon TravelMate 4200 19V 4.74A 90W 5.5MM*1.7MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/liteon/liteon-19V-4.74A-90w-5.5mm-2.5mm.php Liteon Satellite 1100 19V 4.74A 90W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/liteon/liteon-19V-6.3A-120w-4pin-round.php Liteon M3 M5244 19V 6.3A 120W 4 PIN ROUND Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/liteon/liteon-19V-6.3A-120w-5.5mm-2.5mm.php Liteon 2200 R3000 19V 6.3A 120W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/compaq/compaq-18.5V-2.7A-50w-4.8mm-1.7mm.php Compaq NC6000 NC8000 18.5V 2.7A 50W 4.8MM*1.7MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/compaq/compaq-19V-3.16A-60w-5.5mm-2.5mm.php Compaq ZT1000 1200 19V 3.16A 60W 5.5MM*2.5MM Adapter http://www.batterylaptoppower.com/laptop-ac-adapter/compaq/compaq-19V-4.74A-90w-5.5mm-2.5mm.php Compaq NX9000 DV9000 19V 4.74A 90W 5.5MM*2.5MM Adapter

  4. Unknown says:

    http://www.batteryfast.com.au/laptop-ac-adapter/hp/dv2000.htm Hp dv2000 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/dv6000.htm Hp dv6000 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/dv1000.htm Hp dv1000 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/dv4000.htm Hp dv4000 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/dv8000.htm Hp dv8000 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/nc6000.htm Hp nc6000 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/nc8230.htm Hp nc8230 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/nc8000.htm Hp nc8000 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/nc8430.htm Hp nc8430 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/nc6100.htm Hp nc6100 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/nc6120.htm Hp nc6120 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/zt1000.htm Hp zt1000 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/dv9600.htm Hp dv9600 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/dv9700.htm Hp dv9700 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/zv5000.htm Hp zv5000 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/hp/nx9600.htm Hp nx9600 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/ibm/t40.htm Ibm t40 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/ibm/x30.htm Ibm x30 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/ibm/x60.htm Ibm x60 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/m320.htm Liteon m320 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/m680.htm Liteon m680 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/m360.htm Liteon m360 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/m460.htm Liteon m460 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/m500.htm Liteon m500 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/aspire-1200.htm Liteon aspire 1200 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/presario-1200.htm Liteon presario 1200 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/presario-1600.htm Liteon presario 1600 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/presario-1800.htm Liteon presario 1800 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/2200.htm Liteon 2200 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/r3000.htm Liteon r3000 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/m3.htm Liteon m3 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/1500.htm Liteon 1500 Adapter http://www.batteryfast.com.au/laptop-ac-adapter/liteon/1520.htm Liteon 1520 Adapter

  5. Randal says:

    I have used this piece of code on one of my projects, worked very well – Thanks!

  6. Kishore says:

    any luck with this?

Comments are closed.