0

From this link, in the second answer, i could run the commands. Plus i would like to add this command below in one script and export all the data to csv file.is that possible?

Connect-ExchangeOnline 
Get-unified Group | Select Displayname, whenchanged

How to Office 365 Teams Get-Team and Get-Teamuser results export to CSV file

Avshalom
  • 8,657
  • 1
  • 25
  • 43
Toto
  • 1
  • 1

1 Answers1

0

Just add the Export-Csv at the end of the pipeline, like this:

Get-UnifiedGroup | Select Displayname, whenchanged | Export-Csv C:\temp.csv

This is the results for example:

DisplayName WhenChanged        
----------- -----------        
MyGroup     17/08/2021 08:36:22
All Company 27/07/2021 13:39:57
Avshalom
  • 8,657
  • 1
  • 25
  • 43
  • it won't work unfortunately by adding this to the end after $output | Export-csv -Path C:\BatchWiseUserDetails.csv -NoTypeInformation -Encoding UTF8 – Toto Aug 19 '21 at 11:01
  • tested it just now... working as expected just copy the code, of course after you connected to ExchangeOnline using the `Connect-ExchangeOnline -Credential $YourCredentials` – Avshalom Aug 19 '21 at 11:05
  • 1
    @Toto Where does variable `$output` in your comment come from? – Theo Aug 19 '21 at 11:23
  • $ouput comes from the answer from the link that I attached in the quesion. – Toto Aug 19 '21 at 23:20
  • Yes Get-UnifiedGroup | Select Displayname, whenchanged | Export-Csv C:\temp.csv. This command itself works but when i combined the commands from the second answer in the link with it, it does not work – Toto Aug 19 '21 at 23:21