一段利用WSH获取登录时间的jscript代码


复制代码 代码如下:

var enmProfile = new Enumerator(GetObject("winmgmts:").InstancesOf("Win32_NetworkLoginProfile")); 
var arr = new Array("用户名\t最后登录时间"); 
while(!enmProfile.atEnd()) 

        arr.push(enmProfile.item().Name + "\t" + enmProfile.item().LastLogon); 
        enmProfile.moveNext(); 

WSH.Echo(arr.join("\r\n"));

你可能感兴趣的