Long story short, I have a small vbscript that looks like this:
What it's suppose to do, is create a temporary text file with the information I need from my company AD. Then read the file (if this is neccesary) and create a variable for each attribute I have exported.
The temp.txt currently looks like this
What i want it to do, is split those strings into 2 parts. I assume that I will need to make all the strings variables (As i mentioned above).
So I split 1 string variable into 2 string variables.
"Name: TestUser" >>"Name:" "TestUser"
and so on.
So to sum up; I need help with creating these variables and splitting them up. Any help and suggestions appreciated
Code:
objshell.run "cmd /c ldifde -f temp.txt -s MyCompany -d ou=TestOU,dc=MyCompany,dc=local -r objectclass=user -l name,samaccountname,proxyaddresses,mail,memberof,homedrive,homedirectory"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("h:\temp.txt", ForReading)
Const ForReading = 1
Dim arrFileLines()
i = 0
Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close
The temp.txt currently looks like this
Code:
dn: CN=Test User,OU=TestOU,DC=MyCompany,DC=local
changetype: add
memberOf: CN=TestGroup,OU=TestOU,DC=MyCompany,DC=local
name: TestUser
homeDirectory: \\Server\Dir$\TestUser
homeDrive: H:
sAMAccountName: TU
mail: tu@MyCompany.net
So I split 1 string variable into 2 string variables.
"Name: TestUser" >>"Name:" "TestUser"
and so on.
So to sum up; I need help with creating these variables and splitting them up. Any help and suggestions appreciated