Forum Discussion

pardeep soba's avatar
pardeep soba
Copper Contributor
Jun 26, 2017
Solved

how to i add export command to the below script

how to i add export command to the below script   $siteURL = "https://litwareinc.sharepoint.com/sites/finance" $x = Get-SPOSiteGroup -Site $siteURL foreach ($y in $x) { Write-Host $y.Ti...
  • Pieter Veenstra's avatar
    Jun 26, 2017

    How about:

     

    ($siteURL = "https://litwareinc.sharepoint.com/sites/finance"
    $x = Get-SPOSiteGroup -Site $siteURL
    foreach ($y in $x)
        {
            Get-SPOSiteGroup -Site $siteURL -Group $y.Title | Select-Object -ExpandProperty Users
        })| Export-Csv -Path c:\temp\test.csv

     

Resources