Skip to content

Commit ec19f93

Browse files
authored
Update Export-ContentExplorerData.md with best practices and paramete...
...r details
1 parent 6327436 commit ec19f93

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

exchange/exchange-ps/exchange/Export-ContentExplorerData.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ The output of this cmdlet contains the following information:
4141
- RecordsReturned: The number of records returned in the query.
4242
- PageCookie: Used to get the next set of records when MorePagesAvailable is True.
4343

44+
The following list describes best practices for scripts using this cmdlet:
45+
46+
- We recommend not using a single script to export multiple SITs/Labels. Instead, create a script for one SIT/Label, and then re-use the same script for each SIT/Label in each workload as required.
47+
- When retrying the script, make sure to reconnect to the session first. The session's token expires after about an hour, which can cause the cmdlet to fail. To fix this issue, reconnect to the session before retrying the script. If the script fails, restart it using the last page cookie returned to continue the export from where it left off.
48+
49+
> [!TIP]
50+
> To support unattended scripts that run for a long time, you can use [certificate-based authentication (CBA)](https://learn.microsoft.com/powershell/exchange/app-only-auth-powershell-v2?view=exchange-ps).
51+
4452
To use this cmdlet in Security & Compliance PowerShell, you need to be assigned permissions. For more information, see [Permissions in the Microsoft Purview compliance portal](https://learn.microsoft.com/purview/microsoft-365-compliance-center-permissions).
4553

4654
### Scripting
47-
- If the requirement is to export multiple SITs/Labels, it is recommended to not use a single script to export everything. Instead create a script for one SIT/Label and then re-use the same script for each SIT/Label in each workload required.
48-
- When retrying the script, make sure to reconnect to the session first. This is because the session’s token expires after about an hour, which can cause the cmdlet to fail. To fix this issue, reconnect to the session before retrying the script. If the script fails, restart it using the last page cookie returned to continue the export from where it left off.
49-
50-
>[!Tip]
51-
>To support unattended scripts running for long time you can leverage [certificate-based authentication (CBA)](https://learn.microsoft.com/en-us/powershell/exchange/app-only-auth-powershell-v2?view=exchange-ps) flow
5255

5356
## EXAMPLES
5457

@@ -97,7 +100,15 @@ Accept wildcard characters: False
97100
```
98101
99102
### -Aggregate
100-
The Aggregate parameter can be used to get the folder level aggregated numbers instead of getting the details at item level. This will significantly reduce the export time, and if needed internal items of a folder can be downloaded by running the cmdlet for specific folders. When -Aggregate parameter is passed along with TagName, TagType and Workload parameters, the cmdlet will return the list of SiteUrls (ODB/SPO) / UPNs (EXO/Teams) and the count of items stamped with that tag.
103+
The Aggregate parameter switch returns the folder level aggregated numbers instead of getting the details at item level. You don't need to specify a value with this switch.
104+
105+
Using this switch significantly reduces the export time. To download the items in a folder, run this cmdlet for specific folders.
106+
107+
When you use this switch with the TagName, TagType and Workload parameters, the command returns the following information:
108+
109+
- SiteUlrs: OneDrive and SharePoint.
110+
- UPNs: Exchange Online and Microsoft Teams.
111+
- The count of items stamped with that tag.
101112
102113
```yaml
103114
Type: SwitchParameter
@@ -131,6 +142,8 @@ Accept wildcard characters: False
131142
### -PageSize
132143
The PageSize parameter specifies the maximum number of records to return in a single query. Valid input for this parameter is an integer between 1 and 10000. The default value is 100.
133144
145+
**Note**: In empty folders or folders with few files, this parameter can cause the command to run for a long time as it tries to get the PageSize count of the results. To prevent this issue, the command returns data from 5 folders or the number of records specified by the PageSize parameter, whichever completes first. For example, if there are 10 folders with 1 record each, the command returns 5 records of the top 5 folders. In the next execution using page cookie, it returns 5 records from the remaining 5 folders, even if the PageSize value is 10.
146+
134147
```yaml
135148
Type: Int32
136149
Parameter Sets: (All)
@@ -144,10 +157,6 @@ Accept pipeline input: False
144157
Accept wildcard characters: False
145158
```
146159
147-
>[!Note]
148-
>In case of empty folders or folders with less files it will cause the cmdlet to run for a long time inorder to get 'PageSize' count of results. To prevent this, the Cmdlet will return the data of 5 folders or number of records as mentioned in the PageSize, whichever is completed first.
149-
>E.g. if there are 10 folders with 1 record each then in single execution cmdlet will return 5 record of top 5 folders and in the next execution using page cookie it will return 5 records from the remaining 5 folders even if PageSize mentioned is 10.
150-
151160
### -SiteUrl
152161
The SiteUrl parameter specifies the site URL to export file details from.
153162

0 commit comments

Comments
 (0)