Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers. It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.
Set objUser = GetObject(strStringToExecute)
When i write the string out, it looks right so the question is can GetObject accept the variable?
strStringToExecute = char(34) & "LDAP://cn=" & strNameToChange & ", " & strOU & Char(34)
objCommand.CommandText = _ "SELECT distinguishedName FROM 'LDAP://DC=ad,DC=brooksbrothersgroup,dc=com' WHERE objectCategory='user' " & _ "AND cn = '" & strNameToChange & "'" Set objRecordSet = objCommand.Execute if objRecordSet.RecordCount > 0 then strStringToExecute = char(34) & "LDAP://cn=" & strNameToChange & ", " & strOU & Char(34) Set objUser = GetObject(strStringToExecute) objUser.userPrincipalName = txtnewUPN(UsersToChangeCtr) objUser.sAMAccountName = txtnewSMA(UsersToChangeCtr) objUser.scriptPath = txtsp(UsersToChangeCtr) objUser.SetInfo
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.