SendActivationEmail
This is a sample PowerShell script for SendActivationEmail. You may need to modify it to fit your needs and environment.
Copy
function SendActivationEmail {
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 associated with the user that will be emailed
)
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.SendActivationEmailResult] $result = $null
[DashboardServiceReference.SendActivationEmailInput] $in = New-Object DashboardServiceReference.SendActivationEmailInput
[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
# Email the user associated with the device
[DashboardServiceReference.ServiceResponse] $serviceResponse = $proxy.SendActivationEmail($callingContext, $in, [ref] $result)
$result
}