Jump to content
Mdarby

Automate exporting csv is returning the length rather than the contents of the powershell command

Recommended Posts

so the first image is the code inside my execute script line and then it does in fact create the email with the csv file however its returning length which I am assuming is the amount of bytes as bits? idk but if anyone had this issue or knows why its not returning the content I would love to know

lts.png

sdfgsfgs.png

excel.png

Share this post


Link to post
Share on other sites

update: so I got it to display the contents but each row of content is appearing in one square rather than 4 which is the number of columns I have

Share this post


Link to post
Share on other sites
Get-ADUser -filter * -Properties * | Select Name,UserPrincipalName,Created,LastLogonDate | Export-Csv C:\Windows\LTSvc\reports\AD-User_report.csv

Change your code to this.

You are also accessing properties you do not need to. You could just change the properties to be the same as the select.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...