Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 10 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
I believe that worked but is difficult to read without the other attributes. Of course I added that function to my original code commenting out the old and cannot just output the "desc" variable that you have echo'ing. How do I assign another to it so I can just write it out with the other output?
Sorry but I do not understand what you are posting. Why are yo using two variable names?
This is what it should be.
VBScript Code
Double-click the code block to select all.
desc = adoRecordset.Fields("Description").Value
If IsArray(desc) Then
strDescNew = Join(desc,"|")
Else
If Not IsNull(desc) Then
strDescNew = desc
Else
strDescNew = "DESCRIPTION_IS_NULL"
End If
End If
You need to try to keep the formatting so you can see how the code works.
Copying your last post which looks to be a duplicate of mine yields the same output issue. Assigning a new variable so I can utilize it to write the output per your post. I do have it formatted its just not transferring over via copy and paste.
new_user wrote:Copying your last post which looks to be a duplicate of mine yields the same output issue. Assigning a new variable so I can utilize it to write the output per your post. I do have it formatted its just not transferring over via copy and paste.
You need to use the editor tags for VBScript.
I do not understand your issue. The description field is and always has been an array. It is possible for some third party tools and some badly written scripts to put nulls and other illegal characters into the descri0ption field. I cannot help you fix that.
If you are running a Unicode version of the command prompt or are running in a different language then you can have issues. That is up to you to resolve. The VBScript and the LDAP is correct and works cor4recctly on all systems that are set up correctly.
I recommend using the CSVDE utility to dump the user data. Look closely at its output.
If someone has stuffed line breaks or nulls into the description field you will have to fix that in order to get the field to behave correctly.
Lets try this again. They I am sure pasted contents from a ticketing system into the Description field. The normal method I use to grab that does not work in this case because of this, hence my original post. The change in function with your wscript.echo seems to help. I wanted to plug that into my original code. Instead of wscript.echo I wanted to assigned something to the array desc output in order to put it in my current write statement with all of the other ouput. I tried that, it did not work and went back to not putting all if the data for that field on the same line so I posted back to ensure I was actually doing that correctly......
So there is no way to pull the data from the description field into one line of output with a vbscript, so it does not break to a new line?
I thought your new concat function was doing that with the echo statement, i was trying to change from echo to a var name so I could add it to my objFile.WriteLine statement with all of the other variables.
This topic is 10 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.