获取主机名和域用户显示名称

strComputer = "."
Dim WshNetwork
Dim strComputer
Set WshNetwork = WScript.CreateObject("WScript.Network")
strComputer = WshNetwork.ComputerName
Wscript.Echo strComputer
Dim oADSystemInfo
Dim strUserDN
Dim objUser
Set oADSystemInfo = CreateObject("ADSystemInfo")
strUserDN = Replace(oADSystemInfo.UserName,"/","\/")
Set objUser = GetObject("LDAP://" & strUserDN)
Wscript.Echo objUser.AdsPath

你可能感兴趣的:(用户,获取,主机,名称,休闲)