Login | |
|
 |
""" synatax problems (WRAPPING) - 12/12/2005 11:53:40 AM
|
|
 |
|
| |
amfony
Posts: 6
Score: 0
Joined: 9/11/2005
Status: offline
|
Hey gang, objCommand.CommandText = _ "LDAP://dc=Domain;" & "(&(objectCategory=person) (objectClass=user)" & "(sAMAccountName=MyerKen"));" & "sAMAccountName, distinguishedName;subtree" This section of my script will search through my AD from domain level, search sub Ou's, to see if there is another user object with the sAMAccount name "MyerKen". This is cool but i want to substitue "MyerKen" for input from my Excel. Which can be repesented as strLogonID. This is what i tried to do. strlogonTXT = "(sAMAccountName=" & strLogonID & "));" objCommand.CommandText = _ "<LDAP://dc=Domain>;" & "(&(objectCategory=person) (objectClass=user)" & """ & strlogonTXT & """ & "sAMAccountName, distinguishedName;subtree" As is painfully obvious, i need to be able to whack in the strLogonTXT variable to the part of the Command text line with the quotations put in place, without the system 'mistaking' (obviously not its correct, im not) the quoations order kind of thing. How do we do this gentlemen? In semmation, my problems revolves around wrapping variables in "", but where im dropping the variables has already quotation marks so quotation marks get sort of sucked into wrapping OTHER stuff. Hard to explain but im sure you guys know all about it! Thanks guys
|
|
| |
|
|
|
 |
RE: """ synatax problems (WRAPPING) - 12/12/2005 7:04:57 PM
|
|
 |
|
| |
ginolard
Posts: 1021
Score: 21
Joined: 8/10/2005
Status: offline
|
Use CHR(34) "<LDAP://dc=Domain>;" & "(&(objectCategory=person) (objectClass=user)" & chr(34) & strlogonTXT & chr(34) & "sAMAccountName, distinguishedName;subtree" This should work just fine
|
|
| |
|
|
|
 |
RE: """ synatax problems (WRAPPING) - 12/13/2005 12:37:36 AM
|
|
 |
|
| |
Country73
Posts: 712
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
|
Personally I use the chr(34) Whichever way you decide to go, just remember that wscript.echo is your friend. If you're not sure you have enough quotes, or too many, just echo that line out and see what your actually passing along.
|
|
| |
|
|
|
|
|