ReactivateSuspendedDashboardDevice

This is a sample PowerShell script for ReactivateSuspendedDashboardDevice. You may need to modify it to fit your needs and environment.

Copy
function ReactivateSuspendedDashboardDevice {
    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 reactivate
        ) 
            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.ReactivateSuspendedDashboardDeviceResult] $result = $null
    [DashboardServiceReference.ReactivateSuspendedDashboardDeviceInput] $in = New-Object DashboardServiceReference.ReactivateSuspendedDashboardDeviceInput
    [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

    # Reactivate the device
    [DashboardServiceReference.ServiceResponse] $serviceResponse = $proxy.ReactivateSuspendedDashboardDevice($callingContext, $in, [ref] $result)
    $result
}