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.
'==========================================================================
'
' NAME: ListTSAllowed.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE : 6/8/2007
' COPYRIGHT (c) 2007 All Rights Reserved
'
' COMMENT:
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
'==========================================================================
On Error Resume Next
Dim oQuery ' holds query to execute
Dim objConnection ' makes connection to active directory
Dim objCommand ' the command executes the query
Dim objRecordSet ' holds the data returned from the query
Dim oRootDSE
Dim oShell
Set oShell = CreateObject("Wscript.Shell")
forceUseCScript
Sub forceUseCScript()
If Not WScript.FullName = WScript.Path & "\cscript.exe" Then
oShell.Popup "Launched using wscript. Relaunching...",3,"WSCRIPT"
oShell.Run "cmd.exe /k " & WScript.Path & "\cscript.exe //NOLOGO " & Chr(34) & WScript.scriptFullName & Chr(34),1,False
WScript.Quit 0
End If
End Sub
Set oRootDSE = GetObject("LDAP://rootDSE")
oDomain = oRootDSE.get("defaultNamingContext")
oQuery = "<LDAP://" & oDomain & ">;(objectCategory=User);name,distinguishedName;subtree"
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.CommandText = oQuery
Set objRecordSet = objCommand.Execute
While Not objRecordSet.EOF
userDN = objRecordSet.Fields("distinguishedName")
Set objUser = GetObject("LDAP://" & userDN)
padding = Space(35 - Len(objRecordSet.Fields("name")))
objUser.GetInfo
If objUser.AllowLogon = 1 Then
WScript.Echo "User:" & objRecordSet.Fields("name") & padding & "Allow Logon Via Terminal Services: Yes"
Else
WScript.Echo "User:" & objRecordSet.Fields("name") & padding & "Allow Logon Via Terminal Services: No"
End If
objRecordSet.MoveNext
Wend
objConnection.Close