# Remove Resource Provider

Removing a resource provider through below steps would remove the following resources that were originally created during installation,

* Admin and Tenant Resource Provider Registrations
* DNS Zone entries for the resource provider
* The admin and resource groups created for resource providers. This includes a Resource Provider Virtual machine created in the tenant resource group.

#### Steps to remove

1. Get a copy of the resource provider installation package and have it extracted.
2. Open a new elevated (administrative) PowerShell  console and change to the directory where the files have been extracted
3. Run InstallBilling.ps1 script with the parameters shown below

```
.\InstallBilling.ps1 -DefaultProviderSubscriptionId "fill-here" -ServiceAdmin "fill-here" -AdminPassword 'fill-here' -AdminArmEndpoint "fill-here" -ServiceAdminDirectoryTenantName "fill-here" -TenantSubscriptionId "fill-here" -VmLocalAdminPass 'fill-here' -PfxPassword 'fill-here' -SqlServerName "fill-here" -SqlDbName "CloudAssert.Billing" -SqlUser "cadbadmin" -SqlPass 'fill-here' -Apiuser "admin" -ApiPassword 'fill-here' -DacmDatabaseName "CloudAssert.Dacm" -Uninstall $true

E.G.:
.\InstallBilling.ps1 -DefaultProviderSubscriptionId "a088be51-b7e3-47ea-8c83-1ba98e2bbf5f" -ServiceAdmin "cloudassert@contosotest.onmicrosoft.com" -AdminPassword 'TestP@ss1234' -AdminArmEndpoint "https://adminmanagement..local.azurestack.external" -ServiceAdminDirectoryTenantName "contosotest.onmicrosoft.com" -ServiceTenant "cloudassert@contosotest.onmicrosoft.com" -TenantPassword 'TestP@ss1234' -ServiceTenantDirectoryTenantName "contosotest.onmicrosoft.com" -TenantSubscriptionId "00e4fd62-a809-4cd2-a70c-981c97ace666" -VmLocalAdminPass 'TestP@ss1234' -PfxPassword 'TestP@ss1234' -SqlServerName "192.168.102.32" -SqlDbName "CloudAssert.Billing" -SqlUser "cadbadmin" -SqlPass 'TestP@ss1234' -Apiuser "admin" -ApiPassword 'TestP@ss1234' -DacmDatabaseName "CloudAssert.Dacm" -Uninstall $true
```

![](https://108603722-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnRvmq3Z7NHbI7KSziq%2F-MBh4G1ckOXQJotIZg1U%2F-MBh5FlFDj86-e7sT9vo%2Funinstall.PNG?alt=media\&token=dfce3eb9-5d9f-4747-817a-70a674a788ab)

{% hint style="info" %}
Uninstall can take 15-30 minutes to complete normally.
{% endhint %}

&#x20;   &#x20;
