Hi Guys,
I am retrieving the data from AD and sending it to th CSV file. but the data is not coming in Column1,column2 and Column3. Can you guys help me with formatting. PLease see my code below.
Try
dirEntry = New System.DirectoryServices.DirectoryEntry("LDAP://Servername/DC=ffe,DC=fcted,DC=com")
dirSearcher = New System.DirectoryServices.DirectorySearcher(dirEntry)
Dim objStreamWriter As StreamWriter
objStreamWriter = New StreamWriter("\c:Users.csv")
For Each sResultSet As SearchResult In dirSearcher.FindAll
objStreamWriter.Write(GetProperty(sResultSet, "employeenumber"))
objStreamWriter.Write(GetProperty(sResultSet, "mail"))
objStreamWriter.WriteLine(GetProperty(sResultSet, "samaccountname"))
Next
objStreamWriter.Close()
Catch ex As Exception
End Try
When i export the data to Excel the 3 fields i am retrieving are merged. Can you guys help me on how to get the data into excel with individual columns? Appreciate your help. Please see below(currently it is exporting like below)
41693Kei.Wetzle@sports.netKWetzle
I am retrieving the data from AD and sending it to th CSV file. but the data is not coming in Column1,column2 and Column3. Can you guys help me with formatting. PLease see my code below.
Try
dirEntry = New System.DirectoryServices.DirectoryEntry("LDAP://Servername/DC=ffe,DC=fcted,DC=com")
dirSearcher = New System.DirectoryServices.DirectorySearcher(dirEntry)
Dim objStreamWriter As StreamWriter
objStreamWriter = New StreamWriter("\c:Users.csv")
For Each sResultSet As SearchResult In dirSearcher.FindAll
objStreamWriter.Write(GetProperty(sResultSet, "employeenumber"))
objStreamWriter.Write(GetProperty(sResultSet, "mail"))
objStreamWriter.WriteLine(GetProperty(sResultSet, "samaccountname"))
Next
objStreamWriter.Close()
Catch ex As Exception
End Try
When i export the data to Excel the 3 fields i am retrieving are merged. Can you guys help me on how to get the data into excel with individual columns? Appreciate your help. Please see below(currently it is exporting like below)
41693Kei.Wetzle@sports.netKWetzle