13.04.2013 Views

Digipass Plug-In for SBR Administrator Reference - Vasco

Digipass Plug-In for SBR Administrator Reference - Vasco

Digipass Plug-In for SBR Administrator Reference - Vasco

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Digipass</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>SBR</strong> <strong>Administrator</strong> <strong>Reference</strong> <strong>Digipass</strong> TCL Command-Line Administration<br />

14.2.9 Sample Scripts<br />

Below are some sample scripts which per<strong>for</strong>m basic tasks. They range in complexity to provide<br />

an example of what can be done, and the techniques required.<br />

Check if a Component Record exists<br />

This script checks <strong>for</strong> the existence of a RADIUS Client Component record with a specific IP<br />

address. If a Component record of that type and location does not exist, a message will be<br />

displayed onscreen.<br />

# Check if a specified RADIUS Client Component exists<br />

if [catch {component get {comp_type "RADIUS Client" location<br />

192.168.122.213 }} result] {<br />

puts "Component does not exist: $result"<br />

}<br />

Create a Record if it doesn't exist<br />

This script builds on the previous sample to check <strong>for</strong> the existence of a RADIUS Client<br />

Component record and, if one does not currently exist, to create one. It requires a location<br />

parameter to be passed to the script when it is run from DPADMINCMD.<br />

# Get IP-address location from command-line argument<br />

set loc [lindex $argv 0]<br />

# Create the component if it does not exist<br />

if [catch "component get {comp_type {RADIUS Client} location $loc}" result]<br />

{<br />

if [catch "component create {comp_type {RADIUS Client} \<br />

location $loc \<br />

policy_id {VM3 Local Authentication} \<br />

shared_secret default \<br />

protocol RADIUS}" result] {<br />

puts "Error creating component: $result"<br />

} else {<br />

puts "Created component"<br />

}<br />

} else {<br />

puts "Component already exists"<br />

}<br />

To run this script from DPADMINCMD, you would need to use the following syntax:<br />

dpadmincmd -i scriptname loc<br />

Bulk User Administration<br />

This script collects all <strong>Digipass</strong> User records belonging to the domain named Domain1 and<br />

unlocks any which were locked.<br />

# Get all the users of the domain Domain1<br />

if [catch {user query {domain Domain1}} users] {<br />

puts "Unable to retrieve users: $users"<br />

} else {<br />

# Loop <strong>for</strong> each user<br />

<strong>for</strong>each user $users {<br />

# Get the user in<strong>for</strong>mation into an array <strong>for</strong> easier access<br />

© 2006 VASCO Data Security <strong>In</strong>c. 155

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!