This script allows you to deprovision and delete a list of users.
It performs the following steps:
- Transfers the user content to another user’s root folder, specified in the
EmployeeArchiveFolderName parameter.
- Deletes the user.
Prerequisites
Windows
Install the latest version of .NET core.
macOS & Linux
Install PowerShell. Run the pwsh command to test the installation.
Depending on the directory you are
running the command in, the output may differ.
For example:
Box CLI
To use the script, you need the Box CLI
installed and configured. You can do this by following
our . The user you use to log in with should
be the main Box admin or co-admin.
-
Clone the
boxcli GitHub repository and cd into this example’s folder or download the files from examples directory.
-
Create the list of employees for deletion in
.csv.
The header row should look as follows:
where:
name is the name of the user in Box.
email is the primary email address of the user in Box.
For example:
List of parameters
Define script parameters
You can use the following options to pass parameters.
-
Use hardcoded value in script.
To use this option, update all required parameters listed in the script parameters section before running.
-
Run script with parameters.
You can specify parameters while providing the command. For example:
or
If you don’t specify parameters, the script will prompt you to enter them.
Run the script
Now all you need to do is run the script.
-
Run the Powershell command.
-
Run the script:
When all parameters are defined, you will see the following output to confirm the script started:
Logging
Logs are stored in a logs folder located in the main folder.
You have access to these log files:
Users_Deprovision_all.txt that contains all log entries
Users_Deprovision_errors.txt that contains only errors.
Last modified on September 4, 2026