![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | VBScript to dentify which mailboxes have forwarding active. Hi Guys, Was wondering do you guys have any good VB script to perform the above mentioned subject? I've my own VB script but the excel spreadsheet still show the attribute of the domain. Was wondering any way to exclude the attribute? The below is the script e.g 'Global variables Dim oContainer Dim OutPutFile Dim FileSystem Dim tempStr 'On Error Resume Next 'Initialize global variables Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject") Set OutPutFile = FileSystem.CreateTextFile("marketing.txt", True) Set oContainer=GetObject("LDAP://OU=Company Users,DC=Company,DC=com") 'Enumerate Container EnumerateUsers oContainer 'Clean up OutPutFile.Close Set FileSystem = Nothing Set oContainer = Nothing WScript.Echo "Finished" WScript.Quit(0) Sub EnumerateUsers(oCont) Dim oUser, TabStop, NewLine TabStop = Chr(9) NewLine = Chr(10) 'OutPutFile.WriteLine "Name,Designation,Department,Telephone,Fax,Email" For Each oUser In oCont Select Case LCase(oUser.Class) Case "user" tempStr = trim(oUser.displayName) & ";" & trim(oUser.extensionAttribute15) _ & ";" & trim(oUser.Description) _ & ";" & trim(oUser.Department) & ";" & trim(oUser.mobile) _ & ";" & trim(oUser.altRecipient) & ";" & trim(oUser.mail) _ & ";" & trim(oUser.telephoneNumber) & ";" & trim(oUser.sAMAccountName) 'WScript.Echo trim(oUser.sAMAccountName) if oUser.displayName <> "Sunit Chhabra" Then if oUser.protocolSettings <> "" then 'WScript.Echo trim(oUser.displayName) tempStr = tempStr & ";" & trim(CSTR(oUser.protocolSettings)) else tempStr = tempStr & ";" & "<Not Set>" end if Else tempStr = tempStr & ";" & "Enabled" End IF OutPutFile.WriteLine tempStr Case "organizationalunit" , "container" EnumerateUsers oUser End Select Next End Sub Regards, DT |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| VBScript - Add additional Mailboxes | VB Script | |||
| can VBScript determine the active tab of a dialog? | VB Script | |||
| retrieve Active cell "Name" vbscript | VB Script | |||
| vbscript to access all the exchange server mailboxes all at once | VB Script | |||
| mailboxes | Vista mail | |||