<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [getPurchasedServers](./bitburner.ns.getpurchasedservers.md)

## NS.getPurchasedServers() method

Returns an array with the hostnames or IP addresses of all of the servers you have purchased. Returns hostnames by default.

**Signature:**

```typescript
getPurchasedServers(returnOpts?: HostReturnOptions): string[];
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  returnOpts | [HostReturnOptions](./bitburner.hostreturnoptions.md) | _(Optional)_ Optional. Controls whether the function returns IPs |

**Returns:**

string\[\]

Returns an array with the hostnames or IP addresses of all of the servers you have purchased.

## Remarks

1.05 GB

