计算机名称和LDAP信息显示

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)
username = Replace(oADSystemInfo.UserName,"/","-")
LDAPUser="LDAP://" +username
Wscript.Echo objUser.AdsPath
Wscript.Echo LDAPUser

你可能感兴趣的:(职场,计算机,LDAP,名称,休闲)