(1) Use domain account that owns "domain admins" or "account operator"group privilege- net group /domain group001| find /i "login-username" && a.bat || b.bat
复制代码 (2) I use the localgroup to test the above script due to I haven't domain controler at home.- net localgroup users|find /i "poiuy123" > nul && echo poiuy123 account exist || echo poiuy123 acount not exist
复制代码 result as below :
poiuy123 account exist- net localgroup users|find /i "kkkkk123" > nul && echo kkkkk123 account exist || echo kkkkk123 acount not exist
复制代码 result as below :
kkkkk123 acount not exist
(3) above testing just for your reference.
[ 本帖最后由 pdanniel66 于 2011-3-12 19:51 编辑 ] |