# How to unlock BioSamples in BaseSpace using BaseSpace Command Line Interface (CLI)

The [BaseSpace CLI](https://developer.basespace.illumina.com/docs/content/documentation/cli/cli-overview) tool can be used to do this programmatically using the bs biosample unlock {BioSampleId} command:

For Linux/MacOS:

```
bs biosample unlock {biosampleID}  
```

For Windows:

```
bs.exe biosample unlock {biosampleID}  
```

**Notes:**

1. biosampleID is the ID of the biosamples to unlock.
2. There is a way to do this programmatically (unlock multiple biosamples in the project) using BaseSpace CLI.

Couple the command above with command below to loop through a list of Biosample IDs within a given project.

```
bs biosample list --project-id={Project ID} --terse  
```

An example command to unlock multiple biosamples in a project:

* In Linux or Mac OS:

```
bs biosample list --project-id={Project ID} --terse | xargs -I @ bs biosample unlock @  
```

* In Windows Powershell:

```
Foreach($x in (bs.exe biosample list --project-id={Project ID} --terse)){bs.exe unlock biosample $x}  
```

See [Getting Started with BaseSpace CLI](https://www.youtube.com/watch?v=WLAjo9aT7Ms) for more information.

\
\
\ <br>

|                                                                                                                                                                                                                                                                                                                                                                 |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| *For any feedback or questions regarding this article (Illumina Knowledge Article #5845), contact Illumina Technical Support* [*techsupport@illumina.com*](mailto:techsupport@illumina.com?subject=Question%2FFeedback%20Regarding%20Illumina%20Knowledge%20Article%20#000005845%20-%20Software%20\&body=Dear%20Illumina%20Technical%20Support,%0D%0A%0D%0A)*.* |
