Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Help Querying AD

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,52705
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help Querying AD
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Help Querying AD - 10/15/2007 9:28:11 PM   
  4scriptmoni


Posts: 200
Score: 0
Joined: 5/3/2007
Status: offline
I am having a difficult time to get an attribute, I am writing a new script
that will get a User Mailbox Information from its UPN. Unfortunally from WMI "\ROOT\MicrosoftExchangeV2"
there is NO reference to UPN or email. The only match i found is the: msExchMailboxGuid
So I need to get msExchMailboxGuid from AD and the other part i already can do.
Anyways Here is my QUERY:
username = ifile.readline

strQuery = "<GC://DMC01 CN=Local,DC=dmc01.dsl,DC=net>;(&((objectClass=User)(mail=" & "'" & username & "'" & "));"_
          & "msExchMailboxGuid,mail;subtree"
I tryed also
strFilter = "(&(objectCategory=user))(mail=" & "'" & username & "'" & "))"
'strQuery = "<LDAP://OU="& strOU &",DC=dsl,DC=net>;" & strFilter &_
    ' ";msExchMailboxGuid,mail;subtree"

objCommand.CommandText = strQuery
   objCommand.Properties("Page Size") = 500000
   objCommand.Properties("Timeout") = 100
   objCommand.Properties("Cache Results") = False

I get no response no errors but nothing happens... anyone can help?

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net
 
 
Post #: 1
 
 RE: Help Querying AD - 10/15/2007 10:14:51 PM   
  LANlazy

 

Posts: 82
Score: 0
Joined: 4/11/2007
Status: offline
I think the output is an octet you are going to have to convert it to a string because vbscript cant read it.  May be the reason why you are not getting an error.  What info are you trying to pull out with this script?

(in reply to 4scriptmoni)
 
 
Post #: 2
 
 RE: Help Querying AD - 10/15/2007 11:08:20 PM   
  4scriptmoni


Posts: 200
Score: 0
Joined: 5/3/2007
Status: offline
thank you very much. its true it was a octect value. Now i look for a way to convert it.
BTW i am using Digital Skream AD query .
http://www.visualbasicscript.com/m_48443/mpage_1/key_/tm.htm#48443
Once i get the whole code working I will post it.

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to LANlazy)
 
 
Post #: 3
 
 RE: Help Querying AD - 10/17/2007 1:30:09 AM   
  4scriptmoni


Posts: 200
Score: 0
Joined: 5/3/2007
Status: offline
I got it to work and posted the code here:
http://www.visualbasicscript.com/m_52743/mpage_1/key_/tm.htm#52743

cheers,

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to 4scriptmoni)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help Querying AD Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts