Tuesday, May 04, 2010

Check Active Directory Group Membership in Batch Files


echo off
net group "domain admins" /domain | find "%username%" > nul
if errorlevel 1 goto notadmin
goto admin
:admin
echo "these action will be performed if the current user is in the group"
goto quit
:notadmin
echo "notadmin"
:quit

35 comments:

EmogeneJ said...

It's great!!..................................................

文君 said...

朝著既定的目標走,就不會迷失。........................................

文迪 said...

All good things come to an end..............................................

K910athrinA_Petrin0 said...

天下沒有走不通的路,沒有克服不了的困難,沒有打不敗的敵人。.............................................

韋于倫成 said...

脾氣與嘴巴不好,就算心地再好,也不算好人~~~ ....................................................

gocod said...

幫你加油打氣哦!!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

宗HeidiJ_Sco0穎 said...

沒有目標而生活,恰如沒有羅盤而航行 ............................................................

Vi2139 said...

友誼是人生的調味品,也是人生的止痛藥。......................................................................

建宏建宏 said...

It takes all kinds to make a world.................................................................

義珊 said...

很期待新的內容,支持你.................................................................

文群文群 said...

Pen and ink is wits plough.................................................................

靜怡 said...

欣賞是一種美德~回應是最大的支持^^.................................................................

欣怡 said...

人有兩眼一舌,是為了觀察倍於說話的緣故。............................................................

陳登陽 said...

人生是故事的創造與遺忘。............................................................

JasonBirk佳琪 said...

Readiness is all.............................................................

吳婷婷 said...

Actions speak louder than words...................................................................

溫緯李娟王季 said...

Say not all that you know, believe not all that you hear.............................................................

育隆 said...

感謝不吝分享您的心得............................................................

婉婷 said...

感謝分享~希望有更多的好文章分享給大家.................................[/url]...............

林秋萍林秋萍 said...

Prevention is better than cure...................................................

莊雅和莊雅和莊雅和 said...

No one knows the weight of anothers burden. ............................................................

曾法幸 said...

死亡是悲哀的,但活得不快樂更悲哀。. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

穆靜謝苡帆如 said...

Knowledge is a treasure, but practice is the key to it.................................................

吳家達張怡萱張怡萱 said...

Learning makes a good man better and ill man worse.............................................................

家唐銘 said...

Never put off till tomorrow what may be done today..................................................................

宛淑芳真 said...

老天爺賦予了強者的能力,就是要他比弱者多擔待..................................................

王辛江淑萍康 said...

原來這世上能跟你共同領略一個笑話的人竟如此難得......................................................................

446 said...

你的分享很不錯.. 謝謝 ..................................................

柏盧盧盧盧宇 said...

噴泉的高度,不會超過它的源頭。一個人的事業也是如此,它的成就絕不會超過自己的信念。........................................ ........................

江仁趙雲虹昆 said...

當一個人內心能容納兩樣相互衝突的東西,這個人便開始變得有價值了。............................................................

佳張張張張燕張張張張張 said...

Subtlety is better than force. ......................................................................

瑰潼 said...

真得很不錯的blog,留言加油!..................................................................

立和辛和胡辛和辛偉 said...

幸福不是一切,人還有責任。..................................................... ............

储涵 said...

感謝分享~希望有更多的好文章分享給大家.................................[/url]...............

骆雨康 said...

寂寞又無聊 看到你的BLOG 加油喔!!..................................................