Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2919
  • Last Modified:

Powershell output into separate excel columns

Hi Guys, i have the following command and id like to have the output comma separated so that i can have the computername, last logon and time split in to different colums in excel. what would be the best way to acheive this

Get-ADComputer -Filter * -Properties *  | Sort LastLogonDate | FT Name, LastLogonDate

thanks
0
cwstad2
Asked:
cwstad2
1 Solution
 
Joshua GrantomSenior EngineerCommented:
Here you go.

Get-ADComputer -Filter * -Properties LastLogonDate  | Select Name,LastLogonDate | Sort LastLogonDate | Export-CSV C:\Computers.csv -nti

Open in new window

0
 
cwstad2Author Commented:
excellent thanks
0
 
anish kannaCommented:
Thank you so much... works great... thnx a lot
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now