Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Determine if a User is a Local AdministratorContent of Determine if a User is a Local Administrator.jsMD5 Hash: DE731351AC26E259E199D46585C3D686 |
||
var objnetwork = new ActiveXObject("WScript.network");
strcomputer = objnetwork.computername; struser = objnetwork.username; var objgroup = GetObject("WinNT://" + strcomputer + "/administrators"); var myJS_Enumerator_1 = new Enumerator(objgroup.members()); for (;!myJS_Enumerator_1.atEnd();myJS_Enumerator_1.moveNext()) { objuser = myJS_Enumerator_1.item(); if (objuser.name == struser) { WScript.Echo(struser + " is a local administrator."); } } | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |