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
*Note that I initialized 2 hash tables, one called $tokens that will store the token for a given Client Id (i.e Workspace) and another called $invited for storing the number of invited users for a given Client Id.*
89
+
Note that I initialized 2 hash tables, one called $tokens that will store the token for a given Client Id (i.e Workspace) and another called $invited for storing the number of invited users for a given Client Id.
93
90
94
91
### Step 3 – Iterating over the Workspaces sheet to collect client secrets, and retrieve access tokens.
95
92
@@ -124,7 +121,6 @@ if ($XLFile)
124
121
}
125
122
}
126
123
}
127
-
128
124
```
129
125
130
126
Note that, at the end of this loop, I have a hash table of tokens indexed by Client Id, which I will use to call the API in the next section
@@ -175,7 +171,6 @@ Note that, at the end of this loop, I have a hash table of tokens indexed by Cli
175
171
sleep 15
176
172
}
177
173
}
178
-
179
174
```
180
175
181
176
Note that before the loop, I initialized to zero the count of invited users for a given workspace. Also note the sleep 15 (seconds) at the end of the loop to avoid issues with rate limiting constraints which might raise a status code 429.
@@ -233,14 +228,13 @@ foreach ($workspace in $workspaces_excel ) {
233
228
$_users_list | select Username, Status | ft -AutoSize
234
229
235
230
}
236
-
237
231
```
238
232
239
233
## Try it!
240
234
241
235
Let’s run this script, making sure to reference the right Excel spreadsheet:
As you can see, the script has invited 1 user in each workspace, the second email being already a member of the workspace (thus no action is necessary).
0 commit comments