Skip to content

Commit 178ff25

Browse files
committed
Adds Export-SPOUserInfo cmdlet.
1 parent 189849e commit 178ff25

File tree

2 files changed

+152
-0
lines changed

2 files changed

+152
-0
lines changed
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml
3+
Module Name: microsoft.online.sharepoint.powershell
4+
online version:
5+
applicable: SharePoint Online
6+
title: Export-SPOUserInfo
7+
schema: 2.0.0
8+
---
9+
10+
11+
# Export-SPOQueryLogs
12+
13+
## SYNOPSIS
14+
Export query logs for a user in an Office 365 tenant.
15+
16+
## SYNTAX
17+
18+
```
19+
Export-SPOQueryLogs -LoginName <String> [-StartTime <DateTime>] [-OutputFolder <String>] [<CommonParameters>]
20+
```
21+
22+
```
23+
Export-SPOUserInfo -LoginName <String> -Site <SpoSitePipeBind> -OutputFolder <String> [<CommonParameters>]
24+
```
25+
26+
## DESCRIPTION
27+
Export the query logs for a user in an Office 365 tenant. The result of the export is stored in the current working folder or a specified folder, in the two files loginName_queries.csv and loginName_personalQueries.csv.
28+
29+
You have to be a tenant admin to run the cmdlet.
30+
31+
For permissions and the most current information about Windows PowerShell for SharePoint Online, see the online documentation at http://go.microsoft.com/fwlink/p/?LinkId=251832 (http://go.microsoft.com/fwlink/p/?LinkId=251832).
32+
33+
34+
## EXAMPLES
35+
36+
### ------------ Example 1 --------------------
37+
```
38+
Export-SPOUserInfo -LoginName [email protected] -site https://contoso.sharepoint.com/sites/sc1 -OutputFolder "C:\users\admin\exportfolder"
39+
```
40+
Example 1 exports a user data who has the e-mail address [email protected] from the site collection https://contoso.sharepoint.com/sites/sc1 to folder C:\users\admin\exportfolder.
41+
42+
43+
### ------------ Example 2 --------------------
44+
```
45+
$sites = Get-SPOSite -IncludePersonalSite $true
46+
47+
foreach ($site in $sites)
48+
{
49+
Export-SPOUserInfo -LoginName $user -site $site.Url -OutputFolder
50+
"C:\users\admin\exportfolder"
51+
}
52+
```
53+
Example 2 exports user data who has email address [email protected] from all site collections to folder C:\users\admin\exportfolder.
54+
55+
## PARAMETERS
56+
57+
### -LoginName
58+
Specifies the login name of the user to export.
59+
60+
```yaml
61+
Type: String
62+
Parameter Sets: (All)
63+
Aliases:
64+
Applicable: SharePoint Online
65+
66+
Required: True
67+
Position: Named
68+
Default value: None
69+
Accept pipeline input: False
70+
Accept wildcard characters: False
71+
```
72+
73+
### -Site
74+
Specifies the URL of the site collection to which you want to export the user.
75+
76+
```yaml
77+
Type: SpoSitePipeBind
78+
Parameter Sets: (All)
79+
Aliases:
80+
Applicable: SharePoint Online
81+
82+
Required: True
83+
Position: Named
84+
Default value: None
85+
Accept pipeline input: False
86+
Accept wildcard characters: False
87+
```
88+
89+
### -OutputFolder
90+
Target folder where teh CSV file is generated.
91+
92+
```yaml
93+
Type: String
94+
Parameter Sets: (All)
95+
Aliases:
96+
Applicable: SharePoint Online
97+
98+
Required: False
99+
Position: Named
100+
Default value: None
101+
Accept pipeline input: False
102+
Accept wildcard characters: False
103+
```
104+
105+
### -StartTime
106+
{{Fill StartTime Description}}
107+
108+
```yaml
109+
Type: DateTime
110+
Parameter Sets: (All)
111+
Aliases:
112+
Applicable: SharePoint Online
113+
114+
Required: False
115+
Position: Named
116+
Default value: None
117+
Accept pipeline input: False
118+
Accept wildcard characters: False
119+
```
120+
121+
### CommonParameters
122+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
123+
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
124+
125+
## INPUTS
126+
127+
### None
128+
129+
130+
## OUTPUTS
131+
132+
### System.Object
133+
134+
## NOTES
135+
136+
## RELATED LINKS
137+
138+
[Introduction to the SharePoint Online management shell]()
139+
140+
[Set up the SharePoint Online Management Shell Windows PowerShell environment]()
141+
142+
[New-SPOSiteGroup](New-SPOSiteGroup.md)
143+
144+
[Get-SPOUser](Get-SPOUser.md)
145+
146+
[Set-SPOUser](Set-SPOUser.md)
147+
148+
[Remove-SPOUser](Remove-SPOUser.md)
149+

sharepoint/sharepoint-ps/sharepoint-online/sharepoint-online.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ The following cmdlet references are for SharePoint Online.
5252
### [Enable-SPOTenantServicePrincipal](Enable-SPOTenantServicePrincipal.md)
5353
{{Manually Enter Enable-SPOTenantServicePrincipal Description Here}}
5454

55+
### [Export-SPOUserInfo](Export-SPOUserInfo.md)
56+
{{Manually Enter Export-SPOUserInfo Description Here}}
57+
5558
### [Get-SPO365LinkSettings](Get-SPO365LinkSettings.md)
5659
{{Manually Enter Get-SPO365LinkSettings Description Here}}
5760

0 commit comments

Comments
 (0)