좋아, 그건 아니,하지만 ... 그래서VBS 문자열 wizzardry
은 그래서 이것은 내 Exchange 서버에서 실행하고 나는 스팸에 수신인 확인에 사용할 수있는 전자 메일 주소 목록을 덤프 빠른 스크립트 I found on the internet입니다 필터 :
' Export all valid recipients (= proxyAddresses) into a
' file virtual.txt
'
' Ferdinand Hoffmann & Patrick Koetter
' 20021100901
' Shamelessly stolen from
' http://www.microsoft.com/windows2000/techinfo/ \
' planning/activedirectory/bulksteps.asp
'Global variables
Dim Container
Dim OutPutFile
Dim FileSystem
'Initialize global variables
Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
Set OutPutFile = FileSystem.CreateTextFile("virtual.txt", True)
Set Container=GetObject("LDAP://CN=Users,DC=office,DC=example,DC=com")
'Enumerate Container
EnumerateUsers Container
'Clean up
OutPutFile.Close
Set FileSystem = Nothing
Set Container = Nothing
'Say Finished when your done
WScript.Echo "Finished"
WScript.Quit(0)
'List all Users
Sub EnumerateUsers(Cont)
Dim User
'Go through all Users and select them
For Each User In Cont
Select Case LCase(User.Class)
'If you find Users
Case "user"
'Select all proxyAddresses
Dim Alias
If Not IsEmpty(User.proxyAddresses) Then
For Each Alias in User.proxyAddresses
OutPutFile.WriteLine "alias: " & Alias
'WScript.Echo Alias
Next
End If
Case "organizationalunit" , "container"
EnumerateUsers User
End Select
Next
End Sub
캐치는받는 사람 목록은 다음과 같이 돌아 오는 것을 :
smtp:[email protected]
SMTP:[email protected]
x400:c=US;a= ;p=local;o=Exchange;s=lastname;g=firstname;
smtp:[email protected]
smtp:[email protected]
스팸 필터는 "SMT와 라인을 가져 가져 오기 전대있다 p "또는"SMTP "접두어가 붙어 x400은 문제가되지 않습니다. 문제는 VBscript가 "[email protected]"주소를 내보내는 것을 원하지 않는다는 것입니다. 나는 이것을 시도했다 :
'List all Users
Sub EnumerateUsers(Cont)
Dim User
'Go through all Users and select them
For Each User In Cont
Select Case LCase(User.Class)
'If you find Users
Case "user"
'Select all proxyAddresses
Dim Alias
If Not IsEmpty(User.proxyAddresses) Then
For Each Alias in User.proxyAddresses
If Not Alias = "*.lan" Then
OutPutFile.WriteLine "alias: " & Alias
WScript.Echo Alias
End If
Next
End If
Case "organizationalunit" , "container"
EnumerateUsers User
End Select
Next
End Sub
그러나 그것은 아무 것도하지 않는다. 공개 도메인에 대한 일치를 시도했습니다 (Alias = "publicdomain"그렇다면).하지만 결과가 나오지 않았습니다.
그래서 공개 도메인에서만 주소를 얻을 수 있도록 출력을 필터링하는 방법은 무엇입니까?