Script issue

Peter_1985 2,156 Reputation points

How to resolve

Y:\L0\Feb>cscript S1.vbs
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

Y:\L0\Feb\S1.vbs(6, 1) Microsoft VBScript compilation error: Invalid character

with this?

Option Explicit
Dim strUser
Dim objRootLDAP, objContainer, objNewUser
strUser = "User0"

‘ Bind to Active Directory, Users container.
Set objRootLDAP = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Users," & _

‘ Build the actual User.
Set objNewUser = objContainer.Create("User", "cn=" & strUser)
objNewUser.Put "sAMAccountName", strUser


JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
691 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
2,852 questions
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 102.4K Reputation points

    Try removing the ' from ' Bind and ' Build and retype it using a regular single quotation mark (apostrophe).

0 additional answers

Sort by: Most helpful