Need script to check LDAPS

By ashish27071977 ·
I have 110 Domain controllers in my environment. The Platform consists of Windows 2003 Server SP2,Windows 2003 Server x64 SP2, Windows Server 2008.
All the servers are supposed to have certificate installed on them and running on LDAPS.

I need a script which could connect on every server at port636, verify that server is running LDAPS and also connect to its cert store and get the Certificate expiry date.

Guys Please help me with this.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

How can you manage 110 domain controllers

by neilb@uk In reply to Need script to check LDAP ...

and not know how to do this sort of thing?

Here's a link because I'm practising "helpful" this week

Bloody hard, though...

Collapse -

Thanks, Well I wrote a script here.

by ashish27071977 In reply to How can you manage 110 do ...

Thanks I checked the page. Well it is quite helpful.

While I wrote this script for my environment. Hope this post could help some one else too.

' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.1
' AUTHOR: Ashish Tiwari , Hewlett-Packard Company
' DATE : 8/3/2009
Option Explicit
Dim objfso, dclist, result, objserver, objPing, strServerName, objStatus, strline

Set objFSO = CreateObject("scripting.filesystemobject")
Set dclist = objfso.OpenTextFile("dclist.txt")
If objfso.FileExists("result.txt") Then
Set result = objfso.CreateTextFile("result.txt")
Set result = objfso.CreateTextFile("result.txt")
End If

strline = ""

strServerName = dclist.ReadLine
strServerName = Trim(strServerName)
result.WriteLine strline
strline = strServerName & ","
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._
ExecQuery("select Replysize from Win32_PingStatus where address = '" & strServerName & "'")
For Each objStatus in objPing
If IsNull(objStatus.ReplySize) Then
'/ If not reacheable Log the computer name in Log File.
strline = strline & "NotReacheable"
'/ If the server is reachable then
On Error Resume Next
Set objserver = GetObject("LDAP://" & strServerName & ":636")
If Not objServer = Null Then
'/ If connection fails at port 636 via LDAP portocol
strline = strline & "Success"
'/ If connection is successful at port 636 via LDAP portocol
strline = strline & "Failure"
End If
End If
Loop Until dclist.AtEndOfStream

result.WriteLine strline
Set dclist = Nothing
Set result = Nothing
Set objFSO = Nothing
WScript.Echo "Check result.txt file in current folder."

Related Discussions

Related Forums