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: README.md
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -137,8 +137,31 @@ Example:
137
137
```
138
138
111122223333,srodriguez@example.com
139
139
444455556666,rroe@example.com
140
+
141
+
```
142
+
A CSV file can also be generated from the Organizations Master or an account that is Delegated Administrator for GuardDuty/IAM Access Analyzer by running the below code:
143
+
140
144
```
145
+
import boto3
146
+
import csv
147
+
import os
148
+
149
+
## Exports Organizations members as CSV to be used as input for Amazon Detective
141
150
151
+
client = boto3.client('organizations')
152
+
153
+
def create_accounts_csv():
154
+
paginator = client.get_paginator('list_accounts')
155
+
page_iterator = paginator.paginate()
156
+
with open('accounts.csv', mode='w', newline='') as accounts_file:
0 commit comments