aboutsummaryrefslogtreecommitdiffstats
path: root/config/spamd/spamd_exchexp.asp
diff options
context:
space:
mode:
authorserg dvoriancev <dv_serg@mail.ru>2010-04-12 21:52:00 +0400
committerserg dvoriancev <dv_serg@mail.ru>2010-04-12 21:52:00 +0400
commit312f6a4827d742869daba0ebb186b6de5483379a (patch)
tree9285758224d8a53d519f7fab142629397e1ef13d /config/spamd/spamd_exchexp.asp
parent8d8c3e1278c35aaf235710d07cbe6583337700d5 (diff)
parente8fa9505ad3c402bf4a5b5143842c0028382a658 (diff)
downloadpfsense-packages-312f6a4827d742869daba0ebb186b6de5483379a.tar.gz
pfsense-packages-312f6a4827d742869daba0ebb186b6de5483379a.tar.bz2
pfsense-packages-312f6a4827d742869daba0ebb186b6de5483379a.zip
Merge branch 'master' of http://gitweb.pfsense.org/pfsense-packages/mainline
Diffstat (limited to 'config/spamd/spamd_exchexp.asp')
-rw-r--r--config/spamd/spamd_exchexp.asp50
1 files changed, 50 insertions, 0 deletions
diff --git a/config/spamd/spamd_exchexp.asp b/config/spamd/spamd_exchexp.asp
new file mode 100644
index 00000000..56b0c629
--- /dev/null
+++ b/config/spamd/spamd_exchexp.asp
@@ -0,0 +1,50 @@
+<%
+
+dim server
+server = "SERVERNAME"
+
+Sub ExportUsers(oObject)
+ Dim oUser
+ For Each oUser in oObject
+ Select Case oUser.Class
+ Case "user"
+ If oUser.mail <> "" then
+
+ for each email in oUser.proxyAddresses
+ If (lcase(left(email,4))="smtp") Then
+ 'userFile.WriteLine Mid(email,6)
+ document.write Mid(email,6) & vbCrLf
+ End If
+ next
+ End if
+ Case "organizationalUnit" , "container"
+ If UsersinOU (oUser) then
+ ExportUsers(oUser)
+ End if
+ End select
+ Next
+End Sub
+
+Function UsersinOU (oObject)
+ Dim oUser
+ UsersinOU = False
+ for Each oUser in oObject
+ Select Case oUser.Class
+ Case "organizationalUnit" , "container"
+ UsersinOU = UsersinOU(oUser)
+ Case "user"
+ UsersinOU = True
+
+ End select
+ Next
+End Function
+
+Dim rootDSE, domainObject
+Set rootDSE=GetObject("LDAP://" & server & "/RootDSE")
+domainContainer = rootDSE.Get("defaultNamingContext")
+Set domainObject = GetObject("LDAP://" & domainContainer)
+
+ExportUsers(domainObject)
+Set oDomain = Nothing
+
+%> \ No newline at end of file