[英]Get Intranet windows username in php
i can get the windows username in my system but i need to retrieve the windows username from **visitors**.
Visitor means not internet am saying about intranet . 访客的意思并不是互联网在说内联网 。
Am developing intranet website for this only i need: 正在为此开发Intranet网站,我需要:
Below the code for your reference:- 下面的代码供您参考:
/* to get the windows username */
$nw = new COM("WScript.Network");
print "username: " . $nw->username . "<br><br>";
$computername = $nw->computername;
print "computername: $computername<br>";
$owmi = new COM("winmgmts:\\\\$computername\\root\\cimv2");
$comp = $owmi->get("win32_computersystem.name='$computername'" );
print "username: " . $comp->username; echo "<br>";
/* to get the windows username */
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.