Use the following rules when writing a SecureLogin script. Although these rules are not compulsory, they accomplish the following:
Example scripts in this guide follow these rules.
Use capitalization where applicable.
Use This | Instead of This |
---|---|
MessageBox "Some text" -YesNo ?Result |
Messagebox "Some text" -yesno ?result |
Indent sections of scripts between pairs of commands, such as Dialog/EndDialog, Repeat/EndRepeat, and If/Else. An indent of three spaces is optimal.
Use This | Instead of This |
---|---|
If -Text "Some text" |
If -Text "Some text" |
Leave a blank line between sections of the script, such as the Dialog block and the rest of the script.
Place subroutine sections of the script at the bottom of the script, not halfway through. The name of the subroutine should describe its function. It shouldn't simply be a numeric name. The name should follow the rules for capitalizing.
Even if quotation marks aren't required, always use them around segments of text in commands.
Use This | Instead of This |
---|---|
Type "Text"OrIf -Text "Login" |
Type TextOrIf -Text Login |
Begin variable names with a capital letter.
Use This | Instead of This |
---|---|
Type $Username |
Type $username |
Place switches directly after the command (for example, Type -Raw, If -Text).
Use This | Instead of This |
---|---|
Type -Raw $Username |
Type $Username -Raw |
Use program names to represent password policy names for the program they are used for. Don't use numerical names.
Use This | Instead of This |
---|---|
GroupwisePasswordPolicy |
PasswordPolicy3 |
If you want to hide a variable from an administrator by displaying the variable as **** instead of clear text, begin the variable name with $Password. For example, $PasswordPIN will be protected, but $PIN won't be protected.
Use comments throughout the script to explain what each section does and how it does it. At the top of the script, enter and comment out information such as who wrote the script and the date that the script was last modified.
NOTE: To help explain example scripts in the SecureLogin Commands section, this Guide places explanations to the left of the scripts. For example, see Example: Windows Script in AAVerify.
Wherever possible, use the Include command to create generic scripts for commonly used elements, such as password change procedures. For common processes within the script, use subroutines.