Jun 26 2017 07:47 AM
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.Title -ForegroundColor "Yellow" Get-SPOSiteGroup -Site $siteURL -Group $y.Title | Select-Object -ExpandProperty Users Write-Host }
Jun 26 2017 07:51 AM
You might want to give a bit more detail on what you are trying to do? Do you want to export the output to an .txt file?
Jun 26 2017 07:54 AM
export the output to a csv file
thanks
Jun 26 2017 07:56 AM
this script returns a site collection groups and members of those groups
i just want to export the results to csv
Jun 26 2017 08:01 AM - edited Jun 26 2017 08:01 AM
SolutionHow 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
Jun 27 2017 01:38 AM
Try this script
$siteURL = "https://litwareinc.sharepoint.com/sites/finance" $x = Get-SPOSiteGroup -Site $siteURL $GroupList = @() foreach ($y in $x) { $users= Get-SPOSiteGroup -Site $siteURL -Group $y.Title | Select-Object -ExpandProperty Users $Group = "" | Select "Groupname","Userslist" $UsersList = '' foreach($user in $users) { If($UsersList) { $UsersList=$UsersList + ";" + $user.ToString() } Else { $UsersList=$user.ToString() } } $Group.Groupname = $y.Title $Group.Userslist = $UsersList $GroupList+= $Group } $GroupList |Export-csv C:\csv\groupwithusers.csv -NoTypeInformation
Jul 04 2017 09:09 AM
Get-MsolUser -All | Where-Object {$_.Domain -eq "centricaplc.onmicrosoft.com"} | Export-CSV c:\support\cloud.csv
please help am stuck
Jun 26 2017 08:01 AM - edited Jun 26 2017 08:01 AM
SolutionHow 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