Hello,
I am trying to retrieve mail-quata,mail-usage,waring and email address from MS Exchange Server. Uptil now i am able to retrieve only email address of perticular user. Now i want to retrieve his mail-quata,mail-usage and warning(warning means if warning= -10 and mail-quata is 60 MB then i want to give warning on 50 MB of mail-usage..)
Here is my code to retrieve email address of perticular user:
/*---------------------------------------------------------*/
Option Explicit
Dim strUsername,strUsernamea,strpassword,con,rs,Com,objADsPath,objDomain
Set objDomain = GetObject ("GC://rootDSE")
objADsPath = objDomain.Get("defaultNamingContext")
Set objDomain = Nothing
Set con = CreateObject("ADODB.Connection")
con.provider ="ADsDSOObject"
'con.Properties("User ID") = "BURLINGTON\"+strUsername
'con.Properties("Password") = strpassword
con.open "Active Directory Provider"
Set Com = CreateObject("ADODB.Command")
Set Com.ActiveConnection = con
Com.CommandText ="select mail FROM 'LDAP://"+objADsPath+"' where sAMAccountName='vsavalia'"
Set rs = Com.Execute
msgbox rs("mail")
rs.Close
con.Close
Set rs = Nothing
Set con = Nothing
/*--------------------------------------------------------*/
Thanks,
Chintan
I am trying to retrieve mail-quata,mail-usage,waring and email address from MS Exchange Server. Uptil now i am able to retrieve only email address of perticular user. Now i want to retrieve his mail-quata,mail-usage and warning(warning means if warning= -10 and mail-quata is 60 MB then i want to give warning on 50 MB of mail-usage..)
Here is my code to retrieve email address of perticular user:
/*---------------------------------------------------------*/
Option Explicit
Dim strUsername,strUsernamea,strpassword,con,rs,Com,objADsPath,objDomain
Set objDomain = GetObject ("GC://rootDSE")
objADsPath = objDomain.Get("defaultNamingContext")
Set objDomain = Nothing
Set con = CreateObject("ADODB.Connection")
con.provider ="ADsDSOObject"
'con.Properties("User ID") = "BURLINGTON\"+strUsername
'con.Properties("Password") = strpassword
con.open "Active Directory Provider"
Set Com = CreateObject("ADODB.Command")
Set Com.ActiveConnection = con
Com.CommandText ="select mail FROM 'LDAP://"+objADsPath+"' where sAMAccountName='vsavalia'"
Set rs = Com.Execute
msgbox rs("mail")
rs.Close
con.Close
Set rs = Nothing
Set con = Nothing
/*--------------------------------------------------------*/
Thanks,
Chintan