cgunix
asked on
vbs script almost works. Need help with a field name
I found this vbs script which is supposed to list all members in an Active Directory with their "Logon Script". If I comment out the line which is supposed to get the" Logon Script" value, the thing will run and generate the list of AD users.
If I uncomment that line, the thing runs, but fails at the line requesting the logon scirpt, with this
"findNoLogonScriptUsers.vb s(56, 1) ADODB.Recordset: Item cannot be found in the collection corresponding to the requested name or ordinal."
A little research says either I spelled it wrong or I'm asking for a non-existant field.
What I want is the "logon script". I see this value in the AD gui, on the Profile tab. We use several scripts and I type only the name of the script in the gui, the OS knows the path
Here are 2 lines from the vbs script
========================== ===
strName = adoRecordset.Fields("sAMAc countName" ).Value
strScript = adoRecordset.Fields("scrip tPath").va lue
========================== ===
The first apparently works, the second fails.
Is "scriptPath" the field name for the gui "Logog Script" field?
How would I get a list of AD field names? I mean pull it off my system. (Win Svr 2003, also using Exchange Server 2007)
I'm a noobie at this stuff, I'd appreciate any help. If this doesn't work, I can just get it manually
If I uncomment that line, the thing runs, but fails at the line requesting the logon scirpt, with this
"findNoLogonScriptUsers.vb
A little research says either I spelled it wrong or I'm asking for a non-existant field.
What I want is the "logon script". I see this value in the AD gui, on the Profile tab. We use several scripts and I type only the name of the script in the gui, the OS knows the path
Here are 2 lines from the vbs script
==========================
strName = adoRecordset.Fields("sAMAc
strScript = adoRecordset.Fields("scrip
==========================
The first apparently works, the second fails.
Is "scriptPath" the field name for the gui "Logog Script" field?
How would I get a list of AD field names? I mean pull it off my system. (Win Svr 2003, also using Exchange Server 2007)
I'm a noobie at this stuff, I'd appreciate any help. If this doesn't work, I can just get it manually
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you post the part of your code that performs the query, we can test it and modify it for you.
Rob.
Rob.
ASKER
Thanks
LC