Solved

VB script to list user attributes

Posted on 2010-09-15
6
1,519 Views
Last Modified: 2012-06-27
Hi All,

I need a VB script to list the following attributes of all users in my domain.
DN,
cn
userAccountControl,( human readable )
lastLogon ( human readable date )
pwdLastSet ( human readable date )
sAMAccountName
createTimeStamp ( human readable date )
sn
givenName
employeeType      
department      
company

Please help and thanks in advance for your help!
0
Comment
Question by:changjia
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:dax_bad
ID: 33689927
Use the attached script

Shave off the wscript.echo on info you are not interested in. The script crawls through all accounts in your active directory. Run it with cscript to avoid clicking a gazillion msgboxes :-)

/Daniel
On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("PDCname")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\directory\LDAP")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM ds_user", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "ADSIPath: " & objItem.ADSIPath
      WScript.Echo "DS_accountExpires: " & objItem.DS_accountExpires
      strDS_accountNameHistory = Join(objItem.DS_accountNameHistory, ",")
         WScript.Echo "DS_accountNameHistory: " & strDS_accountNameHistory
      WScript.Echo "DS_aCSPolicyName: " & objItem.DS_aCSPolicyName
      WScript.Echo "DS_adminCount: " & objItem.DS_adminCount
      WScript.Echo "DS_adminDescription: " & objItem.DS_adminDescription
      WScript.Echo "DS_adminDisplayName: " & objItem.DS_adminDisplayName
      strDS_allowedAttributes = Join(objItem.DS_allowedAttributes, ",")
         WScript.Echo "DS_allowedAttributes: " & strDS_allowedAttributes
      strDS_allowedAttributesEffective = Join(objItem.DS_allowedAttributesEffective, ",")
         WScript.Echo "DS_allowedAttributesEffective: " & strDS_allowedAttributesEffective
      strDS_allowedChildClasses = Join(objItem.DS_allowedChildClasses, ",")
         WScript.Echo "DS_allowedChildClasses: " & strDS_allowedChildClasses
      strDS_allowedChildClassesEffective = Join(objItem.DS_allowedChildClassesEffective, ",")
         WScript.Echo "DS_allowedChildClassesEffective: " & strDS_allowedChildClassesEffective
      WScript.Echo "DS_altRecipient: " & objItem.DS_altRecipient
      strDS_altRecipientBL = Join(objItem.DS_altRecipientBL, ",")
         WScript.Echo "DS_altRecipientBL: " & strDS_altRecipientBL
      strDS_altSecurityIdentities = Join(objItem.DS_altSecurityIdentities, ",")
         WScript.Echo "DS_altSecurityIdentities: " & strDS_altSecurityIdentities
      WScript.Echo "DS_assistant: " & objItem.DS_assistant
      strDS_attributeCertificate = Join(objItem.DS_attributeCertificate, ",")
         WScript.Echo "DS_attributeCertificate: " & strDS_attributeCertificate
      strDS_attributeCertificateAttribute = Join(objItem.DS_attributeCertificateAttribute, ",")
         WScript.Echo "DS_attributeCertificateAttribute: " & strDS_attributeCertificateAttribute
      strDS_audio = Join(objItem.DS_audio, ",")
         WScript.Echo "DS_audio: " & strDS_audio
      strDS_authOrig = Join(objItem.DS_authOrig, ",")
         WScript.Echo "DS_authOrig: " & strDS_authOrig
      strDS_authOrigBL = Join(objItem.DS_authOrigBL, ",")
         WScript.Echo "DS_authOrigBL: " & strDS_authOrigBL
      WScript.Echo "DS_autoReply: " & objItem.DS_autoReply
      WScript.Echo "DS_autoReplyMessage: " & objItem.DS_autoReplyMessage
      WScript.Echo "DS_badPasswordTime: " & objItem.DS_badPasswordTime
      WScript.Echo "DS_badPwdCount: " & objItem.DS_badPwdCount
      strDS_bridgeheadServerListBL = Join(objItem.DS_bridgeheadServerListBL, ",")
         WScript.Echo "DS_bridgeheadServerListBL: " & strDS_bridgeheadServerListBL
      strDS_businessCategory = Join(objItem.DS_businessCategory, ",")
         WScript.Echo "DS_businessCategory: " & strDS_businessCategory
      WScript.Echo "DS_businessRoles: " & objItem.DS_businessRoles
      WScript.Echo "DS_c: " & objItem.DS_c
      strDS_canonicalName = Join(objItem.DS_canonicalName, ",")
         WScript.Echo "DS_canonicalName: " & strDS_canonicalName
      strDS_carLicense = Join(objItem.DS_carLicense, ",")
         WScript.Echo "DS_carLicense: " & strDS_carLicense
      WScript.Echo "DS_cn: " & objItem.DS_cn
      WScript.Echo "DS_co: " & objItem.DS_co
      WScript.Echo "DS_codePage: " & objItem.DS_codePage
      WScript.Echo "DS_comment: " & objItem.DS_comment
      WScript.Echo "DS_company: " & objItem.DS_company
      strDS_controlAccessRights = Join(objItem.DS_controlAccessRights, ",")
         WScript.Echo "DS_controlAccessRights: " & strDS_controlAccessRights
      WScript.Echo "DS_countryCode: " & objItem.DS_countryCode
      WScript.Echo "DS_createTimeStamp: " & WMIDateStringToDate(objItem.DS_createTimeStamp)
      WScript.Echo "DS_dBCSPwd: " & objItem.DS_dBCSPwd
      strDS_defaultClassStore = Join(objItem.DS_defaultClassStore, ",")
         WScript.Echo "DS_defaultClassStore: " & strDS_defaultClassStore
      WScript.Echo "DS_deletedItemFlags: " & objItem.DS_deletedItemFlags
      WScript.Echo "DS_delivContLength: " & objItem.DS_delivContLength
      WScript.Echo "DS_deliverAndRedirect: " & objItem.DS_deliverAndRedirect
      WScript.Echo "DS_deliveryMechanism: " & objItem.DS_deliveryMechanism
      strDS_delivExtContTypes = Join(objItem.DS_delivExtContTypes, ",")
         WScript.Echo "DS_delivExtContTypes: " & strDS_delivExtContTypes
      WScript.Echo "DS_department: " & objItem.DS_department
      strDS_departmentNumber = Join(objItem.DS_departmentNumber, ",")
         WScript.Echo "DS_departmentNumber: " & strDS_departmentNumber
      strDS_description = Join(objItem.DS_description, ",")
         WScript.Echo "DS_description: " & strDS_description
      WScript.Echo "DS_desktopProfile: " & objItem.DS_desktopProfile
      strDS_destinationIndicator = Join(objItem.DS_destinationIndicator, ",")
         WScript.Echo "DS_destinationIndicator: " & strDS_destinationIndicator
      strDS_directReports = Join(objItem.DS_directReports, ",")
         WScript.Echo "DS_directReports: " & strDS_directReports
      WScript.Echo "DS_displayName: " & objItem.DS_displayName
      WScript.Echo "DS_displayNamePrintable: " & objItem.DS_displayNamePrintable
      WScript.Echo "DS_distinguishedName: " & objItem.DS_distinguishedName
      WScript.Echo "DS_division: " & objItem.DS_division
      WScript.Echo "DS_dLMemDefault: " & objItem.DS_dLMemDefault
      strDS_dLMemRejectPerms = Join(objItem.DS_dLMemRejectPerms, ",")
         WScript.Echo "DS_dLMemRejectPerms: " & strDS_dLMemRejectPerms
      strDS_dLMemRejectPermsBL = Join(objItem.DS_dLMemRejectPermsBL, ",")
         WScript.Echo "DS_dLMemRejectPermsBL: " & strDS_dLMemRejectPermsBL
      strDS_dLMemSubmitPerms = Join(objItem.DS_dLMemSubmitPerms, ",")
         WScript.Echo "DS_dLMemSubmitPerms: " & strDS_dLMemSubmitPerms
      strDS_dLMemSubmitPermsBL = Join(objItem.DS_dLMemSubmitPermsBL, ",")
         WScript.Echo "DS_dLMemSubmitPermsBL: " & strDS_dLMemSubmitPermsBL
      WScript.Echo "DS_dnQualifier: " & objItem.DS_dnQualifier
      WScript.Echo "DS_dSASignature: " & objItem.DS_dSASignature
      strDS_dSCorePropagationData = Join(objItem.DS_dSCorePropagationData, ",")
         WScript.Echo "DS_dSCorePropagationData: " & strDS_dSCorePropagationData
      WScript.Echo "DS_dynamicLDAPServer: " & objItem.DS_dynamicLDAPServer
      WScript.Echo "DS_employeeID: " & objItem.DS_employeeID
      WScript.Echo "DS_employeeNumber: " & objItem.DS_employeeNumber
      WScript.Echo "DS_employeeType: " & objItem.DS_employeeType
      WScript.Echo "DS_enabledProtocols: " & objItem.DS_enabledProtocols
      WScript.Echo "DS_expirationTime: " & WMIDateStringToDate(objItem.DS_expirationTime)
      WScript.Echo "DS_extensionAttribute1: " & objItem.DS_extensionAttribute1
      WScript.Echo "DS_extensionAttribute10: " & objItem.DS_extensionAttribute10
      WScript.Echo "DS_extensionAttribute11: " & objItem.DS_extensionAttribute11
      WScript.Echo "DS_extensionAttribute12: " & objItem.DS_extensionAttribute12
      WScript.Echo "DS_extensionAttribute13: " & objItem.DS_extensionAttribute13
      WScript.Echo "DS_extensionAttribute14: " & objItem.DS_extensionAttribute14
      WScript.Echo "DS_extensionAttribute15: " & objItem.DS_extensionAttribute15
      WScript.Echo "DS_extensionAttribute2: " & objItem.DS_extensionAttribute2
      WScript.Echo "DS_extensionAttribute3: " & objItem.DS_extensionAttribute3
      WScript.Echo "DS_extensionAttribute4: " & objItem.DS_extensionAttribute4
      WScript.Echo "DS_extensionAttribute5: " & objItem.DS_extensionAttribute5
      WScript.Echo "DS_extensionAttribute6: " & objItem.DS_extensionAttribute6
      WScript.Echo "DS_extensionAttribute7: " & objItem.DS_extensionAttribute7
      WScript.Echo "DS_extensionAttribute8: " & objItem.DS_extensionAttribute8
      WScript.Echo "DS_extensionAttribute9: " & objItem.DS_extensionAttribute9
      strDS_extensionData = Join(objItem.DS_extensionData, ",")
         WScript.Echo "DS_extensionData: " & strDS_extensionData
      strDS_extensionName = Join(objItem.DS_extensionName, ",")
         WScript.Echo "DS_extensionName: " & strDS_extensionName
      WScript.Echo "DS_facsimileTelephoneNumber: " & objItem.DS_facsimileTelephoneNumber
      WScript.Echo "DS_flags: " & objItem.DS_flags
      WScript.Echo "DS_folderPathname: " & objItem.DS_folderPathname
      WScript.Echo "DS_formData: " & objItem.DS_formData
      WScript.Echo "DS_forwardingAddress: " & objItem.DS_forwardingAddress
      strDS_fromEntry = Join(objItem.DS_fromEntry, ",")
         WScript.Echo "DS_fromEntry: " & strDS_fromEntry
      strDS_frsComputerReferenceBL = Join(objItem.DS_frsComputerReferenceBL, ",")
         WScript.Echo "DS_frsComputerReferenceBL: " & strDS_frsComputerReferenceBL
      strDS_fRSMemberReferenceBL = Join(objItem.DS_fRSMemberReferenceBL, ",")
         WScript.Echo "DS_fRSMemberReferenceBL: " & strDS_fRSMemberReferenceBL
      WScript.Echo "DS_fSMORoleOwner: " & objItem.DS_fSMORoleOwner
      WScript.Echo "DS_garbageCollPeriod: " & objItem.DS_garbageCollPeriod
      WScript.Echo "DS_gecos: " & objItem.DS_gecos
      WScript.Echo "DS_generationQualifier: " & objItem.DS_generationQualifier
      WScript.Echo "DS_gidNumber: " & objItem.DS_gidNumber
      WScript.Echo "DS_givenName: " & objItem.DS_givenName
      WScript.Echo "DS_groupMembershipSAM: " & objItem.DS_groupMembershipSAM
      strDS_groupPriority = Join(objItem.DS_groupPriority, ",")
         WScript.Echo "DS_groupPriority: " & strDS_groupPriority
      strDS_groupsToIgnore = Join(objItem.DS_groupsToIgnore, ",")
         WScript.Echo "DS_groupsToIgnore: " & strDS_groupsToIgnore
      WScript.Echo "DS_heuristics: " & objItem.DS_heuristics
      WScript.Echo "DS_homeDirectory: " & objItem.DS_homeDirectory
      WScript.Echo "DS_homeDrive: " & objItem.DS_homeDrive
      WScript.Echo "DS_homeMDB: " & objItem.DS_homeMDB
      WScript.Echo "DS_homeMTA: " & objItem.DS_homeMTA
      WScript.Echo "DS_homePhone: " & objItem.DS_homePhone
      WScript.Echo "DS_homePostalAddress: " & objItem.DS_homePostalAddress
      strDS_houseIdentifier = Join(objItem.DS_houseIdentifier, ",")
         WScript.Echo "DS_houseIdentifier: " & strDS_houseIdentifier
      WScript.Echo "DS_importedFrom: " & objItem.DS_importedFrom
      WScript.Echo "DS_info: " & objItem.DS_info
      WScript.Echo "DS_initials: " & objItem.DS_initials
      WScript.Echo "DS_instanceType: " & objItem.DS_instanceType
      strDS_internationalISDNNumber = Join(objItem.DS_internationalISDNNumber, ",")
         WScript.Echo "DS_internationalISDNNumber: " & strDS_internationalISDNNumber
      WScript.Echo "DS_internetEncoding: " & objItem.DS_internetEncoding
      WScript.Echo "DS_ipPhone: " & objItem.DS_ipPhone
      WScript.Echo "DS_isCriticalSystemObject: " & objItem.DS_isCriticalSystemObject
      WScript.Echo "DS_isDeleted: " & objItem.DS_isDeleted
      strDS_isPrivilegeHolder = Join(objItem.DS_isPrivilegeHolder, ",")
         WScript.Echo "DS_isPrivilegeHolder: " & strDS_isPrivilegeHolder
      strDS_jpegPhoto = Join(objItem.DS_jpegPhoto, ",")
         WScript.Echo "DS_jpegPhoto: " & strDS_jpegPhoto
      WScript.Echo "DS_kMServer: " & objItem.DS_kMServer
      WScript.Echo "DS_l: " & objItem.DS_l
      strDS_labeledURI = Join(objItem.DS_labeledURI, ",")
         WScript.Echo "DS_labeledURI: " & strDS_labeledURI
      WScript.Echo "DS_language: " & objItem.DS_language
      WScript.Echo "DS_languageCode: " & objItem.DS_languageCode
      WScript.Echo "DS_lastKnownParent: " & objItem.DS_lastKnownParent
      WScript.Echo "DS_lastLogoff: " & objItem.DS_lastLogoff
      WScript.Echo "DS_lastLogon: " & objItem.DS_lastLogon
      WScript.Echo "DS_lastLogonTimestamp: " & objItem.DS_lastLogonTimestamp
      WScript.Echo "DS_legacyExchangeDN: " & objItem.DS_legacyExchangeDN
      strDS_lmPwdHistory = Join(objItem.DS_lmPwdHistory, ",")
         WScript.Echo "DS_lmPwdHistory: " & strDS_lmPwdHistory
      strDS_localeID = Join(objItem.DS_localeID, ",")
         WScript.Echo "DS_localeID: " & strDS_localeID
      WScript.Echo "DS_lockoutTime: " & objItem.DS_lockoutTime
      WScript.Echo "DS_loginShell: " & objItem.DS_loginShell
      WScript.Echo "DS_logonCount: " & objItem.DS_logonCount
      WScript.Echo "DS_logonHours: " & objItem.DS_logonHours
      WScript.Echo "DS_logonWorkstation: " & objItem.DS_logonWorkstation
      WScript.Echo "DS_mail: " & objItem.DS_mail
      WScript.Echo "DS_mailNickname: " & objItem.DS_mailNickname
      strDS_managedObjects = Join(objItem.DS_managedObjects, ",")
         WScript.Echo "DS_managedObjects: " & strDS_managedObjects
      WScript.Echo "DS_manager: " & objItem.DS_manager
      WScript.Echo "DS_mAPIRecipient: " & objItem.DS_mAPIRecipient
      strDS_masteredBy = Join(objItem.DS_masteredBy, ",")
         WScript.Echo "DS_masteredBy: " & strDS_masteredBy
      WScript.Echo "DS_maxStorage: " & objItem.DS_maxStorage
      WScript.Echo "DS_mDBOverHardQuotaLimit: " & objItem.DS_mDBOverHardQuotaLimit
      WScript.Echo "DS_mDBOverQuotaLimit: " & objItem.DS_mDBOverQuotaLimit
      WScript.Echo "DS_mDBStorageQuota: " & objItem.DS_mDBStorageQuota
      WScript.Echo "DS_mDBUseDefaults: " & objItem.DS_mDBUseDefaults
      strDS_memberOf = Join(objItem.DS_memberOf, ",")
         WScript.Echo "DS_memberOf: " & strDS_memberOf
      strDS_mhsORAddress = Join(objItem.DS_mhsORAddress, ",")
         WScript.Echo "DS_mhsORAddress: " & strDS_mhsORAddress
      WScript.Echo "DS_middleName: " & objItem.DS_middleName
      WScript.Echo "DS_mobile: " & objItem.DS_mobile
      WScript.Echo "DS_modifyTimeStamp: " & WMIDateStringToDate(objItem.DS_modifyTimeStamp)
      WScript.Echo "DS_mS_DS_ConsistencyChildCount: " & objItem.DS_mS_DS_ConsistencyChildCount
      WScript.Echo "DS_mS_DS_ConsistencyGuid: " & objItem.DS_mS_DS_ConsistencyGuid
      WScript.Echo "DS_mS_DS_CreatorSID: " & objItem.DS_mS_DS_CreatorSID
      strDS_msCOM_PartitionSetLink = Join(objItem.DS_msCOM_PartitionSetLink, ",")
         WScript.Echo "DS_msCOM_PartitionSetLink: " & strDS_msCOM_PartitionSetLink
      strDS_msCOM_UserLink = Join(objItem.DS_msCOM_UserLink, ",")
         WScript.Echo "DS_msCOM_UserLink: " & strDS_msCOM_UserLink
      WScript.Echo "DS_msCOM_UserPartitionSetLink: " & objItem.DS_msCOM_UserPartitionSetLink
      strDS_msDFSR_ComputerReferenceBL = Join(objItem.DS_msDFSR_ComputerReferenceBL, ",")
         WScript.Echo "DS_msDFSR_ComputerReferenceBL: " & strDS_msDFSR_ComputerReferenceBL
      strDS_msDFSR_MemberReferenceBL = Join(objItem.DS_msDFSR_MemberReferenceBL, ",")
         WScript.Echo "DS_msDFSR_MemberReferenceBL: " & strDS_msDFSR_MemberReferenceBL
      strDS_msDRM_IdentityCertificate = Join(objItem.DS_msDRM_IdentityCertificate, ",")
         WScript.Echo "DS_msDRM_IdentityCertificate: " & strDS_msDRM_IdentityCertificate
      strDS_msDS_AllowedToDelegateTo = Join(objItem.DS_msDS_AllowedToDelegateTo, ",")
         WScript.Echo "DS_msDS_AllowedToDelegateTo: " & strDS_msDS_AllowedToDelegateTo
      WScript.Echo "DS_msDS_Approx_Immed_Subordinates: " & objItem.DS_msDS_Approx_Immed_Subordinates
      WScript.Echo "DS_msDS_Cached_Membership: " & objItem.DS_msDS_Cached_Membership
      WScript.Echo "DS_msDS_Cached_Membership_Time_Stamp: " & objItem.DS_msDS_Cached_Membership_Time_Stamp
      WScript.Echo "DS_msDS_KeyVersionNumber: " & objItem.DS_msDS_KeyVersionNumber
      strDS_msDs_masteredBy = Join(objItem.DS_msDs_masteredBy, ",")
         WScript.Echo "DS_msDs_masteredBy: " & strDS_msDs_masteredBy
      strDS_msDS_MembersForAzRoleBL = Join(objItem.DS_msDS_MembersForAzRoleBL, ",")
         WScript.Echo "DS_msDS_MembersForAzRoleBL: " & strDS_msDS_MembersForAzRoleBL
      strDS_msDS_NCReplCursors = Join(objItem.DS_msDS_NCReplCursors, ",")
         WScript.Echo "DS_msDS_NCReplCursors: " & strDS_msDS_NCReplCursors
      strDS_msDS_NCReplInboundNeighbors = Join(objItem.DS_msDS_NCReplInboundNeighbors, ",")
         WScript.Echo "DS_msDS_NCReplInboundNeighbors: " & strDS_msDS_NCReplInboundNeighbors
      strDS_msDS_NCReplOutboundNeighbors = Join(objItem.DS_msDS_NCReplOutboundNeighbors, ",")
         WScript.Echo "DS_msDS_NCReplOutboundNeighbors: " & strDS_msDS_NCReplOutboundNeighbors
      strDS_msDS_NonMembersBL = Join(objItem.DS_msDS_NonMembersBL, ",")
         WScript.Echo "DS_msDS_NonMembersBL: " & strDS_msDS_NonMembersBL
      strDS_msDS_ObjectReferenceBL = Join(objItem.DS_msDS_ObjectReferenceBL, ",")
         WScript.Echo "DS_msDS_ObjectReferenceBL: " & strDS_msDS_ObjectReferenceBL
      strDS_msDS_OperationsForAzRoleBL = Join(objItem.DS_msDS_OperationsForAzRoleBL, ",")
         WScript.Echo "DS_msDS_OperationsForAzRoleBL: " & strDS_msDS_OperationsForAzRoleBL
      strDS_msDS_OperationsForAzTaskBL = Join(objItem.DS_msDS_OperationsForAzTaskBL, ",")
         WScript.Echo "DS_msDS_OperationsForAzTaskBL: " & strDS_msDS_OperationsForAzTaskBL
      strDS_msDS_ReplAttributeMetaData = Join(objItem.DS_msDS_ReplAttributeMetaData, ",")
         WScript.Echo "DS_msDS_ReplAttributeMetaData: " & strDS_msDS_ReplAttributeMetaData
      strDS_msDS_ReplValueMetaData = Join(objItem.DS_msDS_ReplValueMetaData, ",")
         WScript.Echo "DS_msDS_ReplValueMetaData: " & strDS_msDS_ReplValueMetaData
      strDS_msDS_Site_Affinity = Join(objItem.DS_msDS_Site_Affinity, ",")
         WScript.Echo "DS_msDS_Site_Affinity: " & strDS_msDS_Site_Affinity
      WScript.Echo "DS_msDS_SourceObjectDN: " & objItem.DS_msDS_SourceObjectDN
      strDS_msDS_TasksForAzRoleBL = Join(objItem.DS_msDS_TasksForAzRoleBL, ",")
         WScript.Echo "DS_msDS_TasksForAzRoleBL: " & strDS_msDS_TasksForAzRoleBL
      strDS_msDS_TasksForAzTaskBL = Join(objItem.DS_msDS_TasksForAzTaskBL, ",")
         WScript.Echo "DS_msDS_TasksForAzTaskBL: " & strDS_msDS_TasksForAzTaskBL
      WScript.Echo "DS_msDS_User_Account_Control_Computed: " & objItem.DS_msDS_User_Account_Control_Computed
      strDS_msExchADCGlobalNames = Join(objItem.DS_msExchADCGlobalNames, ",")
         WScript.Echo "DS_msExchADCGlobalNames: " & strDS_msExchADCGlobalNames
      WScript.Echo "DS_msExchALObjectVersion: " & objItem.DS_msExchALObjectVersion
      WScript.Echo "DS_msExchAssistantName: " & objItem.DS_msExchAssistantName
      WScript.Echo "DS_msExchConferenceMailboxBL: " & objItem.DS_msExchConferenceMailboxBL
      WScript.Echo "DS_msExchControllingZone: " & objItem.DS_msExchControllingZone
      strDS_msExchCustomProxyAddresses = Join(objItem.DS_msExchCustomProxyAddresses, ",")
         WScript.Echo "DS_msExchCustomProxyAddresses: " & strDS_msExchCustomProxyAddresses
      WScript.Echo "DS_msExchExpansionServerName: " & objItem.DS_msExchExpansionServerName
      WScript.Echo "DS_msExchFBURL: " & objItem.DS_msExchFBURL
      WScript.Echo "DS_msExchHideFromAddressLists: " & objItem.DS_msExchHideFromAddressLists
      WScript.Echo "DS_msExchHomeServerName: " & objItem.DS_msExchHomeServerName
      WScript.Echo "DS_msExchHouseIdentifier: " & objItem.DS_msExchHouseIdentifier
      strDS_msExchIMACL = Join(objItem.DS_msExchIMACL, ",")
         WScript.Echo "DS_msExchIMACL: " & strDS_msExchIMACL
      WScript.Echo "DS_msExchIMAddress: " & objItem.DS_msExchIMAddress
      WScript.Echo "DS_msExchIMAPOWAURLPrefixOverride: " & objItem.DS_msExchIMAPOWAURLPrefixOverride
      WScript.Echo "DS_msExchIMMetaPhysicalURL: " & objItem.DS_msExchIMMetaPhysicalURL
      WScript.Echo "DS_msExchIMPhysicalURL: " & objItem.DS_msExchIMPhysicalURL
      WScript.Echo "DS_msExchIMVirtualServer: " & objItem.DS_msExchIMVirtualServer
      WScript.Echo "DS_msExchInconsistentState: " & objItem.DS_msExchInconsistentState
      strDS_msExchLabeledURI = Join(objItem.DS_msExchLabeledURI, ",")
         WScript.Echo "DS_msExchLabeledURI: " & strDS_msExchLabeledURI
      WScript.Echo "DS_msExchMailboxFolderSet: " & objItem.DS_msExchMailboxFolderSet
      WScript.Echo "DS_msExchMailboxGuid: " & objItem.DS_msExchMailboxGuid
      WScript.Echo "DS_msExchMailboxSecurityDescriptor: " & objItem.DS_msExchMailboxSecurityDescriptor
      WScript.Echo "DS_msExchMailboxUrl: " & objItem.DS_msExchMailboxUrl
      WScript.Echo "DS_msExchMasterAccountSid: " & objItem.DS_msExchMasterAccountSid
      strDS_msExchOmaAdminExtendedSettings = Join(objItem.DS_msExchOmaAdminExtendedSettings, ",")
         WScript.Echo "DS_msExchOmaAdminExtendedSettings: " & strDS_msExchOmaAdminExtendedSettings
      WScript.Echo "DS_msExchOmaAdminWirelessEnable: " & objItem.DS_msExchOmaAdminWirelessEnable
      strDS_msExchOriginatingForest = Join(objItem.DS_msExchOriginatingForest, ",")
         WScript.Echo "DS_msExchOriginatingForest: " & strDS_msExchOriginatingForest
      WScript.Echo "DS_msExchPfRootUrl: " & objItem.DS_msExchPfRootUrl
      strDS_msExchPoliciesExcluded = Join(objItem.DS_msExchPoliciesExcluded, ",")
         WScript.Echo "DS_msExchPoliciesExcluded: " & strDS_msExchPoliciesExcluded
      strDS_msExchPoliciesIncluded = Join(objItem.DS_msExchPoliciesIncluded, ",")
         WScript.Echo "DS_msExchPoliciesIncluded: " & strDS_msExchPoliciesIncluded
      WScript.Echo "DS_msExchPolicyEnabled: " & objItem.DS_msExchPolicyEnabled
      strDS_msExchPolicyOptionList = Join(objItem.DS_msExchPolicyOptionList, ",")
         WScript.Echo "DS_msExchPolicyOptionList: " & strDS_msExchPolicyOptionList
      WScript.Echo "DS_msExchPreviousAccountSid: " & objItem.DS_msExchPreviousAccountSid
      strDS_msExchProxyCustomProxy = Join(objItem.DS_msExchProxyCustomProxy, ",")
         WScript.Echo "DS_msExchProxyCustomProxy: " & strDS_msExchProxyCustomProxy
      WScript.Echo "DS_msExchQueryBaseDN: " & objItem.DS_msExchQueryBaseDN
      WScript.Echo "DS_msExchRecipLimit: " & objItem.DS_msExchRecipLimit
      WScript.Echo "DS_msExchRequireAuthToSendTo: " & objItem.DS_msExchRequireAuthToSendTo
      strDS_msExchResourceGUID = Join(objItem.DS_msExchResourceGUID, ",")
         WScript.Echo "DS_msExchResourceGUID: " & strDS_msExchResourceGUID
      strDS_msExchResourceProperties = Join(objItem.DS_msExchResourceProperties, ",")
         WScript.Echo "DS_msExchResourceProperties: " & strDS_msExchResourceProperties
      WScript.Echo "DS_msExchTUIPassword: " & objItem.DS_msExchTUIPassword
      WScript.Echo "DS_msExchTUISpeed: " & objItem.DS_msExchTUISpeed
      WScript.Echo "DS_msExchTUIVolume: " & objItem.DS_msExchTUIVolume
      WScript.Echo "DS_msExchUnmergedAttsPt: " & objItem.DS_msExchUnmergedAttsPt
      WScript.Echo "DS_msExchUseOAB: " & objItem.DS_msExchUseOAB
      WScript.Echo "DS_msExchUserAccountControl: " & objItem.DS_msExchUserAccountControl
      WScript.Echo "DS_msExchVoiceMailboxID: " & objItem.DS_msExchVoiceMailboxID
      WScript.Echo "DS_msIIS_FTPDir: " & objItem.DS_msIIS_FTPDir
      WScript.Echo "DS_msIIS_FTPRoot: " & objItem.DS_msIIS_FTPRoot
      strDS_mSMQDigests = Join(objItem.DS_mSMQDigests, ",")
         WScript.Echo "DS_mSMQDigests: " & strDS_mSMQDigests
      strDS_mSMQDigestsMig = Join(objItem.DS_mSMQDigestsMig, ",")
         WScript.Echo "DS_mSMQDigestsMig: " & strDS_mSMQDigestsMig
      WScript.Echo "DS_mSMQSignCertificates: " & objItem.DS_mSMQSignCertificates
      WScript.Echo "DS_mSMQSignCertificatesMig: " & objItem.DS_mSMQSignCertificatesMig
      WScript.Echo "DS_msNPAllowDialin: " & objItem.DS_msNPAllowDialin
      strDS_msNPCallingStationID = Join(objItem.DS_msNPCallingStationID, ",")
         WScript.Echo "DS_msNPCallingStationID: " & strDS_msNPCallingStationID
      strDS_msNPSavedCallingStationID = Join(objItem.DS_msNPSavedCallingStationID, ",")
         WScript.Echo "DS_msNPSavedCallingStationID: " & strDS_msNPSavedCallingStationID
      WScript.Echo "DS_msRADIUSCallbackNumber: " & objItem.DS_msRADIUSCallbackNumber
      WScript.Echo "DS_msRADIUSFramedIPAddress: " & objItem.DS_msRADIUSFramedIPAddress
      strDS_msRADIUSFramedRoute = Join(objItem.DS_msRADIUSFramedRoute, ",")
         WScript.Echo "DS_msRADIUSFramedRoute: " & strDS_msRADIUSFramedRoute
      WScript.Echo "DS_msRADIUSServiceType: " & objItem.DS_msRADIUSServiceType
      WScript.Echo "DS_msRASSavedCallbackNumber: " & objItem.DS_msRASSavedCallbackNumber
      WScript.Echo "DS_msRASSavedFramedIPAddress: " & objItem.DS_msRASSavedFramedIPAddress
      strDS_msRASSavedFramedRoute = Join(objItem.DS_msRASSavedFramedRoute, ",")
         WScript.Echo "DS_msRASSavedFramedRoute: " & strDS_msRASSavedFramedRoute
      WScript.Echo "DS_msRTCSIP_ArchivingEnabled: " & objItem.DS_msRTCSIP_ArchivingEnabled
      WScript.Echo "DS_msRTCSIP_FederationEnabled: " & objItem.DS_msRTCSIP_FederationEnabled
      WScript.Echo "DS_msRTCSIP_InternetAccessEnabled: " & objItem.DS_msRTCSIP_InternetAccessEnabled
      WScript.Echo "DS_msRTCSIP_Line: " & objItem.DS_msRTCSIP_Line
      WScript.Echo "DS_msRTCSIP_LineServer: " & objItem.DS_msRTCSIP_LineServer
      WScript.Echo "DS_msRTCSIP_OptionFlags: " & objItem.DS_msRTCSIP_OptionFlags
      WScript.Echo "DS_msRTCSIP_OriginatorSid: " & objItem.DS_msRTCSIP_OriginatorSid
      WScript.Echo "DS_msRTCSIP_PrimaryHomeServer: " & objItem.DS_msRTCSIP_PrimaryHomeServer
      WScript.Echo "DS_msRTCSIP_PrimaryUserAddress: " & objItem.DS_msRTCSIP_PrimaryUserAddress
      WScript.Echo "DS_msRTCSIP_TargetHomeServer: " & objItem.DS_msRTCSIP_TargetHomeServer
      WScript.Echo "DS_msRTCSIP_UserEnabled: " & objItem.DS_msRTCSIP_UserEnabled
      strDS_msRTCSIP_UserExtension = Join(objItem.DS_msRTCSIP_UserExtension, ",")
         WScript.Echo "DS_msRTCSIP_UserExtension: " & strDS_msRTCSIP_UserExtension
      strDS_msRTCSIP_UserPolicy = Join(objItem.DS_msRTCSIP_UserPolicy, ",")
         WScript.Echo "DS_msRTCSIP_UserPolicy: " & strDS_msRTCSIP_UserPolicy
      WScript.Echo "DS_msSFU30Name: " & objItem.DS_msSFU30Name
      WScript.Echo "DS_msSFU30NisDomain: " & objItem.DS_msSFU30NisDomain
      strDS_msSFU30PosixMemberOf = Join(objItem.DS_msSFU30PosixMemberOf, ",")
         WScript.Echo "DS_msSFU30PosixMemberOf: " & strDS_msSFU30PosixMemberOf
      WScript.Echo "DS_name: " & objItem.DS_name
      strDS_netbootSCPBL = Join(objItem.DS_netbootSCPBL, ",")
         WScript.Echo "DS_netbootSCPBL: " & strDS_netbootSCPBL
      strDS_networkAddress = Join(objItem.DS_networkAddress, ",")
         WScript.Echo "DS_networkAddress: " & strDS_networkAddress
      strDS_nonSecurityMemberBL = Join(objItem.DS_nonSecurityMemberBL, ",")
         WScript.Echo "DS_nonSecurityMemberBL: " & strDS_nonSecurityMemberBL
      strDS_ntPwdHistory = Join(objItem.DS_ntPwdHistory, ",")
         WScript.Echo "DS_ntPwdHistory: " & strDS_ntPwdHistory
      WScript.Echo "DS_nTSecurityDescriptor: " & objItem.DS_nTSecurityDescriptor
      strDS_o = Join(objItem.DS_o, ",")
         WScript.Echo "DS_o: " & strDS_o
      WScript.Echo "DS_objectCategory: " & objItem.DS_objectCategory
      strDS_objectClass = Join(objItem.DS_objectClass, ",")
         WScript.Echo "DS_objectClass: " & strDS_objectClass
      WScript.Echo "DS_objectGUID: " & objItem.DS_objectGUID
      WScript.Echo "DS_objectSid: " & objItem.DS_objectSid
      WScript.Echo "DS_objectVersion: " & objItem.DS_objectVersion
      WScript.Echo "DS_operatorCount: " & objItem.DS_operatorCount
      strDS_otherFacsimileTelephoneNumber = Join(objItem.DS_otherFacsimileTelephoneNumber, ",")
         WScript.Echo "DS_otherFacsimileTelephoneNumber: " & strDS_otherFacsimileTelephoneNumber
      strDS_otherHomePhone = Join(objItem.DS_otherHomePhone, ",")
         WScript.Echo "DS_otherHomePhone: " & strDS_otherHomePhone
      strDS_otherIpPhone = Join(objItem.DS_otherIpPhone, ",")
         WScript.Echo "DS_otherIpPhone: " & strDS_otherIpPhone
      strDS_otherLoginWorkstations = Join(objItem.DS_otherLoginWorkstations, ",")
         WScript.Echo "DS_otherLoginWorkstations: " & strDS_otherLoginWorkstations
      strDS_otherMailbox = Join(objItem.DS_otherMailbox, ",")
         WScript.Echo "DS_otherMailbox: " & strDS_otherMailbox
      strDS_otherMobile = Join(objItem.DS_otherMobile, ",")
         WScript.Echo "DS_otherMobile: " & strDS_otherMobile
      strDS_otherPager = Join(objItem.DS_otherPager, ",")
         WScript.Echo "DS_otherPager: " & strDS_otherPager
      strDS_otherTelephone = Join(objItem.DS_otherTelephone, ",")
         WScript.Echo "DS_otherTelephone: " & strDS_otherTelephone
      strDS_otherWellKnownObjects = Join(objItem.DS_otherWellKnownObjects, ",")
         WScript.Echo "DS_otherWellKnownObjects: " & strDS_otherWellKnownObjects
      strDS_ou = Join(objItem.DS_ou, ",")
         WScript.Echo "DS_ou: " & strDS_ou
      strDS_ownerBL = Join(objItem.DS_ownerBL, ",")
         WScript.Echo "DS_ownerBL: " & strDS_ownerBL
      WScript.Echo "DS_pager: " & objItem.DS_pager
      WScript.Echo "DS_partialAttributeDeletionList: " & objItem.DS_partialAttributeDeletionList
      WScript.Echo "DS_partialAttributeSet: " & objItem.DS_partialAttributeSet
      WScript.Echo "DS_personalPager: " & objItem.DS_personalPager
      WScript.Echo "DS_personalTitle: " & objItem.DS_personalTitle
      strDS_photo = Join(objItem.DS_photo, ",")
         WScript.Echo "DS_photo: " & strDS_photo
      WScript.Echo "DS_physicalDeliveryOfficeName: " & objItem.DS_physicalDeliveryOfficeName
      WScript.Echo "DS_pOPCharacterSet: " & objItem.DS_pOPCharacterSet
      WScript.Echo "DS_pOPContentFormat: " & objItem.DS_pOPContentFormat
      strDS_possibleInferiors = Join(objItem.DS_possibleInferiors, ",")
         WScript.Echo "DS_possibleInferiors: " & strDS_possibleInferiors
      strDS_postalAddress = Join(objItem.DS_postalAddress, ",")
         WScript.Echo "DS_postalAddress: " & strDS_postalAddress
      WScript.Echo "DS_postalCode: " & objItem.DS_postalCode
      strDS_postOfficeBox = Join(objItem.DS_postOfficeBox, ",")
         WScript.Echo "DS_postOfficeBox: " & strDS_postOfficeBox
      strDS_preferredDeliveryMethod = Join(objItem.DS_preferredDeliveryMethod, ",")
         WScript.Echo "DS_preferredDeliveryMethod: " & strDS_preferredDeliveryMethod
      WScript.Echo "DS_preferredLanguage: " & objItem.DS_preferredLanguage
      WScript.Echo "DS_preferredOU: " & objItem.DS_preferredOU
      WScript.Echo "DS_primaryGroupID: " & objItem.DS_primaryGroupID
      WScript.Echo "DS_primaryInternationalISDNNumber: " & objItem.DS_primaryInternationalISDNNumber
      WScript.Echo "DS_primaryTelexNumber: " & objItem.DS_primaryTelexNumber
      WScript.Echo "DS_profilePath: " & objItem.DS_profilePath
      strDS_protocolSettings = Join(objItem.DS_protocolSettings, ",")
         WScript.Echo "DS_protocolSettings: " & strDS_protocolSettings
      WScript.Echo "DS_proxiedObjectName: " & objItem.DS_proxiedObjectName
      strDS_proxyAddresses = Join(objItem.DS_proxyAddresses, ",")
         WScript.Echo "DS_proxyAddresses: " & strDS_proxyAddresses
      strDS_publicDelegates = Join(objItem.DS_publicDelegates, ",")
         WScript.Echo "DS_publicDelegates: " & strDS_publicDelegates
      strDS_publicDelegatesBL = Join(objItem.DS_publicDelegatesBL, ",")
         WScript.Echo "DS_publicDelegatesBL: " & strDS_publicDelegatesBL
      WScript.Echo "DS_pwdLastSet: " & objItem.DS_pwdLastSet
      strDS_queryPolicyBL = Join(objItem.DS_queryPolicyBL, ",")
         WScript.Echo "DS_queryPolicyBL: " & strDS_queryPolicyBL
      strDS_registeredAddress = Join(objItem.DS_registeredAddress, ",")
         WScript.Echo "DS_registeredAddress: " & strDS_registeredAddress
      WScript.Echo "DS_replicatedObjectVersion: " & objItem.DS_replicatedObjectVersion
      WScript.Echo "DS_replicationSensitivity: " & objItem.DS_replicationSensitivity
      WScript.Echo "DS_replicationSignature: " & objItem.DS_replicationSignature
      WScript.Echo "DS_replPropertyMetaData: " & objItem.DS_replPropertyMetaData
      WScript.Echo "DS_replUpToDateVector: " & objItem.DS_replUpToDateVector
      strDS_repsFrom = Join(objItem.DS_repsFrom, ",")
         WScript.Echo "DS_repsFrom: " & strDS_repsFrom
      strDS_repsTo = Join(objItem.DS_repsTo, ",")
         WScript.Echo "DS_repsTo: " & strDS_repsTo
      WScript.Echo "DS_revision: " & objItem.DS_revision
      WScript.Echo "DS_rid: " & objItem.DS_rid
      strDS_roomNumber = Join(objItem.DS_roomNumber, ",")
         WScript.Echo "DS_roomNumber: " & strDS_roomNumber
      WScript.Echo "DS_sAMAccountName: " & objItem.DS_sAMAccountName
      WScript.Echo "DS_sAMAccountType: " & objItem.DS_sAMAccountType
      WScript.Echo "DS_scriptPath: " & objItem.DS_scriptPath
      WScript.Echo "DS_sDRightsEffective: " & objItem.DS_sDRightsEffective
      strDS_secretary = Join(objItem.DS_secretary, ",")
         WScript.Echo "DS_secretary: " & strDS_secretary
      WScript.Echo "DS_securityIdentifier: " & objItem.DS_securityIdentifier
      strDS_securityProtocol = Join(objItem.DS_securityProtocol, ",")
         WScript.Echo "DS_securityProtocol: " & strDS_securityProtocol
      strDS_seeAlso = Join(objItem.DS_seeAlso, ",")
         WScript.Echo "DS_seeAlso: " & strDS_seeAlso
      strDS_serialNumber = Join(objItem.DS_serialNumber, ",")
         WScript.Echo "DS_serialNumber: " & strDS_serialNumber
      strDS_serverReferenceBL = Join(objItem.DS_serverReferenceBL, ",")
         WScript.Echo "DS_serverReferenceBL: " & strDS_serverReferenceBL
      strDS_servicePrincipalName = Join(objItem.DS_servicePrincipalName, ",")
         WScript.Echo "DS_servicePrincipalName: " & strDS_servicePrincipalName
      WScript.Echo "DS_shadowExpire: " & objItem.DS_shadowExpire
      WScript.Echo "DS_shadowFlag: " & objItem.DS_shadowFlag
      WScript.Echo "DS_shadowInactive: " & objItem.DS_shadowInactive
      WScript.Echo "DS_shadowLastChange: " & objItem.DS_shadowLastChange
      WScript.Echo "DS_shadowMax: " & objItem.DS_shadowMax
      WScript.Echo "DS_shadowMin: " & objItem.DS_shadowMin
      WScript.Echo "DS_shadowWarning: " & objItem.DS_shadowWarning
      strDS_showInAddressBook = Join(objItem.DS_showInAddressBook, ",")
         WScript.Echo "DS_showInAddressBook: " & strDS_showInAddressBook
      WScript.Echo "DS_showInAdvancedViewOnly: " & objItem.DS_showInAdvancedViewOnly
      strDS_sIDHistory = Join(objItem.DS_sIDHistory, ",")
         WScript.Echo "DS_sIDHistory: " & strDS_sIDHistory
      strDS_siteObjectBL = Join(objItem.DS_siteObjectBL, ",")
         WScript.Echo "DS_siteObjectBL: " & strDS_siteObjectBL
      WScript.Echo "DS_sn: " & objItem.DS_sn
      WScript.Echo "DS_st: " & objItem.DS_st
      WScript.Echo "DS_street: " & objItem.DS_street
      WScript.Echo "DS_streetAddress: " & objItem.DS_streetAddress
      strDS_structuralObjectClass = Join(objItem.DS_structuralObjectClass, ",")
         WScript.Echo "DS_structuralObjectClass: " & strDS_structuralObjectClass
      WScript.Echo "DS_submissionContLength: " & objItem.DS_submissionContLength
      strDS_subRefs = Join(objItem.DS_subRefs, ",")
         WScript.Echo "DS_subRefs: " & strDS_subRefs
      strDS_subSchemaSubEntry = Join(objItem.DS_subSchemaSubEntry, ",")
         WScript.Echo "DS_subSchemaSubEntry: " & strDS_subSchemaSubEntry
      strDS_supplementalCredentials = Join(objItem.DS_supplementalCredentials, ",")
         WScript.Echo "DS_supplementalCredentials: " & strDS_supplementalCredentials
      WScript.Echo "DS_supportedAlgorithms: " & objItem.DS_supportedAlgorithms
      WScript.Echo "DS_systemFlags: " & objItem.DS_systemFlags
      WScript.Echo "DS_targetAddress: " & objItem.DS_targetAddress
      WScript.Echo "DS_telephoneAssistant: " & objItem.DS_telephoneAssistant
      WScript.Echo "DS_telephoneNumber: " & objItem.DS_telephoneNumber
      strDS_teletexTerminalIdentifier = Join(objItem.DS_teletexTerminalIdentifier, ",")
         WScript.Echo "DS_teletexTerminalIdentifier: " & strDS_teletexTerminalIdentifier
      strDS_telexNumber = Join(objItem.DS_telexNumber, ",")
         WScript.Echo "DS_telexNumber: " & strDS_telexNumber
      WScript.Echo "DS_terminalServer: " & objItem.DS_terminalServer
      WScript.Echo "DS_textEncodedORAddress: " & objItem.DS_textEncodedORAddress
      WScript.Echo "DS_thumbnailLogo: " & objItem.DS_thumbnailLogo
      WScript.Echo "DS_thumbnailPhoto: " & objItem.DS_thumbnailPhoto
      WScript.Echo "DS_title: " & objItem.DS_title
      strDS_tokenGroups = Join(objItem.DS_tokenGroups, ",")
         WScript.Echo "DS_tokenGroups: " & strDS_tokenGroups
      strDS_tokenGroupsGlobalAndUniversal = Join(objItem.DS_tokenGroupsGlobalAndUniversal, ",")
         WScript.Echo "DS_tokenGroupsGlobalAndUniversal: " & strDS_tokenGroupsGlobalAndUniversal
      strDS_tokenGroupsNoGCAcceptable = Join(objItem.DS_tokenGroupsNoGCAcceptable, ",")
         WScript.Echo "DS_tokenGroupsNoGCAcceptable: " & strDS_tokenGroupsNoGCAcceptable
      strDS_uid = Join(objItem.DS_uid, ",")
         WScript.Echo "DS_uid: " & strDS_uid
      WScript.Echo "DS_uidNumber: " & objItem.DS_uidNumber
      strDS_unauthOrig = Join(objItem.DS_unauthOrig, ",")
         WScript.Echo "DS_unauthOrig: " & strDS_unauthOrig
      strDS_unauthOrigBL = Join(objItem.DS_unauthOrigBL, ",")
         WScript.Echo "DS_unauthOrigBL: " & strDS_unauthOrigBL
      WScript.Echo "DS_unicodePwd: " & objItem.DS_unicodePwd
      WScript.Echo "DS_unixHomeDirectory: " & objItem.DS_unixHomeDirectory
      strDS_unixUserPassword = Join(objItem.DS_unixUserPassword, ",")
         WScript.Echo "DS_unixUserPassword: " & strDS_unixUserPassword
      WScript.Echo "DS_unmergedAtts: " & objItem.DS_unmergedAtts
      strDS_url = Join(objItem.DS_url, ",")
         WScript.Echo "DS_url: " & strDS_url
      WScript.Echo "DS_userAccountControl: " & objItem.DS_userAccountControl
      WScript.Echo "DS_userCert: " & objItem.DS_userCert
      strDS_userCertificate = Join(objItem.DS_userCertificate, ",")
         WScript.Echo "DS_userCertificate: " & strDS_userCertificate
      WScript.Echo "DS_userParameters: " & objItem.DS_userParameters
      strDS_userPassword = Join(objItem.DS_userPassword, ",")
         WScript.Echo "DS_userPassword: " & strDS_userPassword
      strDS_userPKCS12 = Join(objItem.DS_userPKCS12, ",")
         WScript.Echo "DS_userPKCS12: " & strDS_userPKCS12
      WScript.Echo "DS_userPrincipalName: " & objItem.DS_userPrincipalName
      WScript.Echo "DS_userSharedFolder: " & objItem.DS_userSharedFolder
      strDS_userSharedFolderOther = Join(objItem.DS_userSharedFolderOther, ",")
         WScript.Echo "DS_userSharedFolderOther: " & strDS_userSharedFolderOther
      strDS_userSMIMECertificate = Join(objItem.DS_userSMIMECertificate, ",")
         WScript.Echo "DS_userSMIMECertificate: " & strDS_userSMIMECertificate
      WScript.Echo "DS_userWorkstations: " & objItem.DS_userWorkstations
      WScript.Echo "DS_uSNChanged: " & objItem.DS_uSNChanged
      WScript.Echo "DS_uSNCreated: " & objItem.DS_uSNCreated
      WScript.Echo "DS_uSNDSALastObjRemoved: " & objItem.DS_uSNDSALastObjRemoved
      WScript.Echo "DS_USNIntersite: " & objItem.DS_USNIntersite
      WScript.Echo "DS_uSNLastObjRem: " & objItem.DS_uSNLastObjRem
      WScript.Echo "DS_uSNSource: " & objItem.DS_uSNSource
      WScript.Echo "DS_versionNumber: " & objItem.DS_versionNumber
      strDS_wbemPath = Join(objItem.DS_wbemPath, ",")
         WScript.Echo "DS_wbemPath: " & strDS_wbemPath
      strDS_wellKnownObjects = Join(objItem.DS_wellKnownObjects, ",")
         WScript.Echo "DS_wellKnownObjects: " & strDS_wellKnownObjects
      WScript.Echo "DS_whenChanged: " & WMIDateStringToDate(objItem.DS_whenChanged)
      WScript.Echo "DS_whenCreated: " & WMIDateStringToDate(objItem.DS_whenCreated)
      WScript.Echo "DS_wWWHomePage: " & objItem.DS_wWWHomePage
      strDS_x121Address = Join(objItem.DS_x121Address, ",")
         WScript.Echo "DS_x121Address: " & strDS_x121Address
      strDS_x500uniqueIdentifier = Join(objItem.DS_x500uniqueIdentifier, ",")
         WScript.Echo "DS_x500uniqueIdentifier: " & strDS_x500uniqueIdentifier
      WScript.Echo
   Next
Next


Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm: 
	WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
	Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
	& " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function

Open in new window

0
 
LVL 6

Accepted Solution

by:
dax_bad earned 250 total points
ID: 33691273
Actually scratch the above script and use this one instead mate... The above uses WMI to query the AD and the returned dates and timestamp are not user friendly.The attached script uses LDAP and gives you the requested info.

Cheers
Daniel
On Error Resume Next

'Change GroupName to the name of the group whose members you want to export
'Enter the correct OU structure
strGroup1 = "ou1"
strGroup2 = "ou2"
strGroup3 = "ou3"
strGroup4 = "ou4"
strComputer = "PDCname"	'change to primary DC
strFileName = "ADuser_info_" & Replace(Date, "/", "-") &  ".txt"	'remove TEST 
strFolder = "<drive>:\<foldername>"
strPath = strFolder & strFileName
Counter = 0
' Get domain name
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")

Set objFSO = CreateObject("Scripting.FileSystemObject")
'On the next line change the name and path of the file that export data will be written to.
Set objFile = objFSO.CreateTextFile(strPath)

ldap = "LDAP://" & strComputer & "/ou=" & strGroup4 & ",ou=" & strGroup3 & ",ou=" & strGroup2 & ",ou=" & strGroup1 & "," & strDNSDomain

Set objOU = GetObject(ldap)	

objFile.WriteLine "                          Active Directory Users - " & Date
objFile.WriteLine "          Security Group - /ou=" & strGroup4 & ",ou=" & strGroup3 & ",ou=" & strGroup2 & ",ou=" & strGroup1 & "," & strDNSDomain
objFile.WriteLine "------------------------------------------------------------------------------------"

'List the below attributes for all users in the above group
For Each objUser In objOU
objFile.WriteLine "distinguishedName: " & objUser.distinguishedName
objFile.WriteLine "cn: " & objUser.cn
objFile.WriteLine "userAccountControl: " & objUser.userAccountControl
objFile.WriteLine "Last login: " & objUser.lastLogin
objFile.WriteLine "pwdLastSet: " & objUser.PasswordLastChanged
objFile.WriteLine "sAMAccountName: " & objUser.sAMAccountName
objFile.WriteLine "Created: " & objUser.WhenCreated
objFile.WriteLine "sn: " & objUser.sn
objFile.WriteLine "givenName: " & objUser.givenName
objFile.WriteLine "employeeType: " & objUser.employeeType
objFile.WriteLine "department: " & objUser.department
objFile.WriteLine "company: " & objUser.company & vbCrLf
Counter = Counter + 1
Next

objFile.WriteLine "------------------------------------------------------------------------------------"
objFile.WriteLine "Number of AD user accounts listed: " & counter
objFile.WriteLine "------------------------------------------------------------------------------------"

objFile.Close
Set objRootDSE = Nothing
Set objFSO = Nothing
Set objOU = Nothing

Open in new window

0
 
LVL 17

Assisted Solution

by:Tony Massa
Tony Massa earned 250 total points
ID: 33691297
Most of that can be simply exported using adfind and applying the -TDCA command:

for example, this ADFIND command will create a file you can import into excel with a semicolon delimeter:

It won't do lastLogon for all domain controllers, just the one it uses to get the rest of the info.  If you have a 2003 domain in Native Mode, you will get LLTS also.
ADFIND -default -f "(&(objectCategory=Person)(objectClass=user))" -csvdelim ; cn userAccountControl lastLogon lastlogontimestamp pwdLastSet sAMAccountName whenCreated sn givenName employeeType department company -csv > c:\userinfo.txt

Open in new window

0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:changjia
ID: 33692268
Guys, thanks for the script, but they all list out timestamp as 8 bits interger, which is not human readable. I need to be converted into date format.

Thnaks
0
 
LVL 17

Expert Comment

by:Tony Massa
ID: 33692351
Here are the vbScript functions needed to convert Integer8Dates and DTM dates.  

Like I said, you can get all of that info (except *real* lastLogon) using ADFIND from Joeware.net

http://www.joeware.net/freetools/tools/adfind/index.htm
Function Integer8Date(ByVal objDate, ByVal lngBias)

    ' Function to convert Integer8 (64-bit) value to a date, adjusted for

    ' local time zone bias.

    Dim lngAdjust, lngDate, lngHigh, lngLow

    lngAdjust = lngBias

    lngHigh = objDate.HighPart

    lngLow = objdate.LowPart

    ' Account for bug in IADslargeInteger property methods.

    If (lngLow < 0) Then

        lngHigh = lngHigh + 1

    End If

    If (lngHigh = 0) And (lngLow = 0) Then

        lngAdjust = 0

    End If

    lngDate = #1/1/1601# + (((lngHigh * (2 ^ 32)) _

        + lngLow) / 600000000 - lngAdjust) / 1440

    Integer8Date = CDate(lngDate)

End Function



Function WMIDateStringToDate(dtmWMIDate)

    If Not IsNull(dtmWMIDate) Then

    WMIDateStringToDate = CDate(Mid(dtmWMIDate, 5, 2) & "/" & _

         Mid(dtmWMIDate, 7, 2) & "/" & Left(dtmWMIDate, 4) _

             & " " & Mid (dtmWMIDate, 9, 2) & ":" & _

                 Mid(dtmWMIDate, 11, 2) & ":" & Mid(dtmWMIDate, 13, 2))

    End If

End Function

Open in new window

0
 
LVL 17

Expert Comment

by:Tony Massa
ID: 33692658
Just to get an idea of the difficulty of lastLogon, here's a sample script to get the real last logons of all users. Use CSCRIPT to run this, and add " > output.txt" to export to a file.

1/1/1601 = Never
LastLogons-AllUsers.vbs.txt
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now