DeleteDataFromDashboardDevice
This is a sample PowerShell script for DeleteDataFromDashboardDevice. You may need to modify it to fit your needs and environment.
Copy
function DeleteDataFromDashboardDevice {
param (
[Parameter(Mandatory=$true)] $UserName # Dashboard username
,$Password # Dashboard password will prompt
,[Parameter(Mandatory=$true)] $DashboardUrl # Dashboard URL. Example: https://vault.example.com
,[parameter(Mandatory = $true)] [Guid] $DeviceID # Device ID of the device to delete data from
)
if (!$Password -or ($Password -eq "*")) {
$Password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR((read-host -assecurestring -Prompt "Enter the password for $UserName")))
}
# Load the WSDL
$proxy = New-WebServiceProxy -Uri "$DashboardUrl/Dashboard/DashboardService.v.1.0.svc?WSDL" -Namespace "DashboardServiceReference" -Class "foo"
#Create the web service reference
[DashboardServiceReference.DeleteDataFromDashboardDeviceResult] $result = $null
[DashboardServiceReference.DeleteDataFromDashboardDeviceInput] $in = New-Object DashboardServiceReference.DeleteDataFromDashboardDeviceInput
[DashboardServiceReference.CallingContext] $callingContext = New-Object DashboardServiceReference.CallingContext
#Set up calling credentials
$callingContext.ContextIdentity = $UserName
$callingContext.AuthenticationToken = $Password
$callingContext.TokenType = [DashboardServiceReference.AuthenticationTokenType]::Password
$callingContext.TokenTypeSpecified = $true
#Identify the device
$in.DeviceId = $DeviceID
# Delete the protected data from the device
[DashboardServiceReference.ServiceResponse] $serviceResponse = $proxy.DeleteDataFromDashboardDevice($callingContext, $in, [ref] $result)
$result
}