Frist time scripter
- From: Brucelee <Brucelee@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 23 Mar 2006 14:59:02 -0800
Hi guys I have a really dumb question. I copied this script from the
internet and cannot get it to run on my exchange server. I change the file
from *.txt to *.cmd and all I get is the path to each argument. So I get
lots of c:\blahh blahh stuff that maps directly to each argument in the
script. Now as I explain this I have to say that I am running this from my
exchange server and not a domain controller, is that the issue. I will run
it from a domain controller as soon as I get home.
here is the script;
On Error Resume Next
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT Name, altRecipient FROM 'LDAP://dc=domain,dc=com' WHERE
objectCategory='user' " & _
"AND altRecipient='*'"
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Wscript.Echo objRecordSet.Fields("Name").Value,
objRecordSet.Fields("altRecipient").Value
objRecordSet.MoveNext
Loop
--
Thanks for the help
TC
.
- Follow-Ups:
- RE: Frist time scripter
- From: /\/\o\/\/ [MVP]
- Re: Frist time scripter
- From: Richard Mueller
- RE: Frist time scripter
- Prev by Date: Re: [MSH] Monad Covered in this Week's Hanselminutes Podcast
- Next by Date: Re: Frist time scripter
- Previous by thread: First time scripter
- Next by thread: Re: Frist time scripter
- Index(es):
Relevant Pages
|