my $ldap_session=Net::LDAP->new($ldaphost) or die "error connecting to LDAP $ldaphost: $@\n";
my $mesg=$ldap_session->bind($ldapuser, password=>$ldappassword) or die "error binding: $@\n";
my $temp=$ldap_session->search(
base=>$base,
filter=>"(distinguishedName=$user)",
attrs=> [ '*' ] ) or die "error searching tree:$@\n";
my $tempuser = $temp->entry(0);
$data->{securityflag}=$tempuser->get_value('nTSecurityDescriptor')?$tempuser->get_value('nTSecurityDescriptor'):'none';
my @attributes=$tempuser->attributes;
$data->{values}='';
foreach(@attributes){
$data->{values}=$data->{values}.'
'.$_.'='.$tempuser->get_value($_);
}
####
objectClass
cn
sn
c
l
st
title
postalCode
physicalDeliveryOfficeName
telephoneNumber
facsimileTelephoneNumber
userCertificate
givenName
initials
distinguishedName
instanceType
whenCreated
whenChanged
displayName
uSNCreated
info
memberOf
uSNChanged
co
department
company
proxyAddresses
streetAddress
displayNamePrintable
name
objectGUID
userAccountControl
badPwdCount
codePage
countryCode
homeDirectory
homeDrive
badPasswordTime
lastLogoff
lastLogon
logonHours
pwdLastSet
primaryGroupID
userParameters
objectSid
adminCount
accountExpires
logonCount
sAMAccountName
sAMAccountType
showInAddressBook
legacyExchangeDN
userPrincipalName
lockoutTime
objectCategory
msNPAllowDialin
dSCorePropagationData
lastLogonTimestamp
mail
manager
mobile
pager
msRTCSIP-PrimaryUserAddress
ciscoEcsbuTransferId
msExchRecordedName
mailNickname
publicDelegatesBL
ciscoEcsbuAmisDisableOutbound
msRTCSIP-UserEnabled
msExchPoliciesIncluded
ciscoEcsbuUMLocationObjectId
msRTCSIP-ArchivingEnabled
msExchRecipientDisplayType
mDBUseDefaults
ciscoEcsbuDtmfId
msRTCSIP-PrimaryHomeServer
ciscoEcsbuObjectType
ciscoEcsbuListInUMDirectory
msExchMailboxGuid
msExchUserCulture
msExchMailboxSecurityDescriptor
msExchUserAccountControl
msRTCSIP-OptionFlags
msExchRecipientTypeDetails
msExchVersion
msExchMobileMailboxFlags
homeMTA
homeMDB
msExchHomeServerName
ciscoEcsbuUnityAttributes