Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
'Create output file
Set fs = CreateObject ("Scripting.FileSystemObject")
filePath = "c:\temp\Names.txt"
Set outFile = fs.CreateTextFile (filePath)
outFile.Close
userID=InputBox("Enter user id ")
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRootDSE=GetObject("LDAP://RootDSE")
strDNSDomain=objRootDSE.Get("defaultNamingContext")
strTarget="LDAP://" & strDNSDomain
objCommand.CommandText = _
"SELECT sAMAccountname, displayName FROM '" & strTarget & "' WHERE objectCategory='user' and sAMAccountName='" & userID & "'"
Set objRecordSet = objCommand.Execute
Set ts = fs.OpenTextFile(filePath,8)
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
LoginID = objRecordSet.Fields("sAMAccountname").Value
displayName = objRecordSet.Fields("displayName").Value
If IsNull(displayName) Then
displayName=" "
End If
objRecordSet.MoveNext
ts.WriteLine LoginID & " - " & displayName
Loop
ts.Close
MsgBox "Script has completed..."
WScript.Quit