You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tables/microsoft365_drive.md
+145-1Lines changed: 145 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,4 +136,148 @@ from
136
136
where
137
137
user_id = 'test@org.onmicrosoft.com'
138
138
and filter = 'name eq ''Steampipe''';
139
-
```
139
+
```
140
+
141
+
### Explore drive quota and storage information
142
+
Analyze drive storage usage and quota information to understand how much space users are consuming and monitor storage patterns across your organization.
143
+
144
+
```sql+postgres
145
+
select
146
+
name,
147
+
drive_type,
148
+
quota ->> 'used' as used_bytes,
149
+
quota ->> 'total' as total_bytes,
150
+
quota ->> 'remaining' as remaining_bytes,
151
+
quota ->> 'state' as quota_state,
152
+
round((quota ->> 'used')::bigint / 1024.0 / 1024.0, 2) as used_mb,
Explore drives that have SharePoint integration by examining the sharepoint_ids field. This is useful for understanding which drives are connected to SharePoint sites and document libraries.
182
+
183
+
```sql+postgres
184
+
select
185
+
name,
186
+
id,
187
+
drive_type,
188
+
sharepoint_ids,
189
+
owner,
190
+
created_date_time,
191
+
web_url
192
+
from
193
+
microsoft365_drive
194
+
where
195
+
user_id = 'test@org.onmicrosoft.com'
196
+
and sharepoint_ids is not null;
197
+
```
198
+
199
+
```sql+sqlite
200
+
select
201
+
name,
202
+
id,
203
+
drive_type,
204
+
sharepoint_ids,
205
+
owner,
206
+
created_date_time,
207
+
web_url
208
+
from
209
+
microsoft365_drive
210
+
where
211
+
user_id = 'test@org.onmicrosoft.com'
212
+
and sharepoint_ids is not null;
213
+
```
214
+
215
+
### Get drive details with owner information
216
+
Explore detailed drive information including owner details and creation information to understand drive ownership and management within your organization.
217
+
218
+
```sql+postgres
219
+
select
220
+
name,
221
+
id,
222
+
drive_type,
223
+
owner,
224
+
created_by,
225
+
last_modified_by,
226
+
created_date_time,
227
+
last_modified_date_time,
228
+
web_url
229
+
from
230
+
microsoft365_drive
231
+
where
232
+
user_id = 'test@org.onmicrosoft.com';
233
+
```
234
+
235
+
```sql+sqlite
236
+
select
237
+
name,
238
+
id,
239
+
drive_type,
240
+
owner,
241
+
created_by,
242
+
last_modified_by,
243
+
created_date_time,
244
+
last_modified_date_time,
245
+
web_url
246
+
from
247
+
microsoft365_drive
248
+
where
249
+
user_id = 'test@org.onmicrosoft.com';
250
+
```
251
+
252
+
### List drives by type with storage analysis
253
+
Analyze drives by type (personal, business, documentLibrary) and their storage usage to understand the distribution of different drive types and their storage patterns.
254
+
255
+
```sql+postgres
256
+
select
257
+
drive_type,
258
+
count(*) as drive_count,
259
+
round(avg((quota ->> 'used')::bigint / 1024.0 / 1024.0), 2) as avg_used_mb,
0 commit comments