Results 1 to 3 of 3

Thread: Help with vbscript syntax???

  1. #1
    New Member
    Join Date
    May 12
    Posts
    3

    Help with vbscript syntax???

    I need help with the right syntax. I am trying to populate the LDAP line with the value of
    strComputer, but I can't get the right syntax. Can anyone help? See my code below.


    strComputer='someone'

    Set objNewOU = GetObject("LDAP://OU=Computers,OU=a state,DC=anyplace,DC=com")

    Set objMoveComputer = objNewOU.MoveHere _
    ("LDAP://CN=strComputer,CN=Computers,DC=anyplace,DC=com", "CN=strComputer")

  2. #2
    New Member
    Join Date
    May 12
    Posts
    3

    Re: Help with vbscript syntax???

    I'm new to this. Trying a different syntax still results in a 'expected end of statement error' on the last line.


    strComputer="someone"
    strMigrationOU="CN=Computers,DC=anyplace,DC=com"

    Set objNewOU = GetObject("LDAP://OU=Computers,DC=anyplace,DC=com")

    Set objMoveComputer = objNewOU.MoveHere _
    "LDAP://CN=" & strComputer & "," & strMigrationOU & "," & "CN=" & strComputer

  3. #3
    New Member
    Join Date
    May 12
    Posts
    3

    Re: Help with vbscript syntax???

    I think I figured it out. Adding () around the statement corrects the error.

    ("LDAP://CN=" & strComputer & "," & strMigrationOU & "," & "CN=" & strComputer)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •