|
Note: Please refer to the File Paths appendix for the correct path(s) based on the version of Desktop Authority you are using. |
Desktop Authority uses replication as a method of publishing Desktop Authority configurations to selected targets, which are usually Domain Controllers.
A log file is created during the replication process and lists each file that is published and to which folder. The log file is named SlRepl.txt.
This file can be located on the Operations Master in either (32-bit OS) - %Program Files%\Quest\Desktop Authority\Desktop Authority Manager or (64-bit OS) - %Program Files (x86)%\Quest\Desktop Authority\Desktop Authority Manager.
User Management files are published from the %Program Files%\Quest\Desktop Authority\Desktop Authority Manager\Scripts or %Program Files (x86)%\Quest\Desktop Authority\Desktop Authority Manager\Scripts, which is shared as SLscripts$.
User Management files are replicated to the User Management replication folder specified in Server Manager. This folder, by default, is \\server_name\NETLOGON (%windir%\SYSVOL\sysvol\[Domain Name]\scripts folder is shared as NETLOGON), but can be changed if necessary.
Computer Management files are published from (32-bit OS) - %Program Files%\Quest\Desktop Authority\Desktop Authority Manager\Device Policy Master or (64-bit OS) - %Program Files (x86)%\Quest\Desktop Authority\Desktop Authority Manager\Device Policy Master.
This folder is shared as DADevicePolicyMaster$.
Computer Management files are replicated to the Computer Management replication folder specified in Server Manager. This folder, by default, is SYSVOL\[DomainName]\Policies\Desktop Authority\Device Policy Master, but can be changed if necessary.
The Desktop Authority API is a documented set of functions, variables and supplemental utility programs that allow you to fully harness the capabilities of Desktop Authority through custom scripting.
The Desktop Authority API can be broken down into four categories:
Functions: Wrap many lines of KiXtart code (and supplemental utilities) into a single line of code, for easy insertion into your custom scripts. Many of the Desktop Authority API functions are direct replacements for native KiXtart functions -- and they can overcome the security restrictions of the user logging on.
Dynamic Variables: Globally defined variables in the Desktop Authority engine. These variables are used by the engine itself and can be used in custom scripting.
Utility Programs have been developed to expand upon the built-in functionality of KiXtart. These tools are often wrapped by API Functions eliminating the need to execute them directly.
Predefined Dynamic Variables can be used to aid in the creation of configuration elements. These variables are globally defined and used by Desktop Authority during the client logon process. Using them is helpful, if not a necessity, when writing custom scripts.
Dynamic Variables can be used in virtually every field within the Desktop Authority manager, including those fields with built-in lists. Simply press the F2 key to display a dialog that allows the selection of a predefined variable from a visual list. The dynamic variable will be inserted at the current position of the cursor.
These variables are available for a few different categories:
Applications Variables
Date and Time Variables
Folder and Disk Variables
Messaging System Variables
Network Variables
Operating System Variables
Security Variables
System Variables
Connection Type:
LAN - LAN or WAN connection
RAS - dial-up networking connection
Current date (e.g. "2000/04/01")
Description (from UMD)
Location of OS DLL's (e.g. Windows - "C:\Windows\System") (e.g. Win NT - "D:\WinNT\System32")
Domain (or Workgroup) that computer belongs to.
If set to 1 in a custom script, Desktop Authority will immediately exit after pre or post-engine custom scripts complete.
Available disk space on $SystemDrive (in bytes)
Available disk space on $SystemDrive (in Megabytes)
"morning", "afternoon" or "evening", based on time of day 00:00-11:59, 12:00-17:59, 18:00-23:59, respectively.
Base sharename part of $HomePath. (e.g. "Users")
'Long' name of the directory part of the home directory. (e.g. "bjohnson")
Complete home path, including the server, base share and home directory. (e.g. "\\Server1\Users\JohnSmith")
Server-only part of $HomePath, without leading backslashes. (e.g. "MyServer")
Server & base share parts of $HomePath. (e.g. "\\Server\Users")
TCP/IP host name of the client.
Internet Explorer Version
IP address ( First address detected )
The first octet of $IPAddr
The second octet of $IPAddr
The third octet of $IPAddr
The fourth octet of $IPAddr
Authenticating Domain Controller - without leading backslashes. (Example: "server1')
Authenticating Domain Controller - with leading backslashes. (Example: "\\server1")
Network MAC address (adapter 0)
Name of the default Windows Messaging System profile for the user logging on.
location of Desktop Authority scripts on authenticating server in UNC form.
Example 1 - "\\server1\netlogon"
Example 2 - "\\server2\netlogon\site1"
Numeric value of the OS version, expressed as an integer (e.g. 40 or 50)
a PDC, BDC or Member Server will return "Server"
an NT Workstation or Windows 2000 Professional will return "Workstation"
Operating System build number (e.g. 1381)
Operating System current service pack (e.g. Service Pack 4.0)
Operating System type:
95 - Windows 95
98 - Windows 98
NT - All versions of NT/2000
Operating System version (e.g. " NT Workstation 4.0")
Privilege level of user on the domain: "User" or "Admin"
Loc. of Program Files on the client (e.g. " C:\Program Files")
Number of days before password expiration.
If set to 1, user will be forced to logoff. A 2 will force the client to reboot.
Location of client's Application Data shell folder.
Location of client's Temporary Internet Files shell folder.
Location of client's Cookies folder.
Location of client's Desktop shell folder
Location of NT client's Common (All Users) Desktop shell folder.
Location of client's Favorites shell folder (IE bookmarks).
Location of client's Fonts shell folder.
Location of client's History shell folder.
Location of client's Local Application Data shell folder.
Location of client's My Pictures shell folder.
Location of client's Network Neighborhood shell folder.
Location of client's Personal shell folder.
Location of client's Printer Neighborhood shell folder.
Location of client's Start-Menu Programs shell folder.
Location of NT client's Common (All Users) Start-Menu Programs shell folder.
Location of client's Recent Documents shell folder.
Location of client's Send To shell folder.
Location of NT client's Common (All Users) Start-Menu shell folder.
Location of client's Start-Menu shell folder
Location of client's Startup shell folder.
Location of client's Templates shell folder.
System Info: CPU #1 MHz (approx.)
System Info: CPU #1 Type
System Info: CPU #1 Vendor ID
Security Identifier (SID) of current user.
System Info: Size of desktop (Width x Height)
System Info: Size of Hard Drive #1
System Info: Physical memory, in Mb
System Info: System BIOS Date
System Info: System BIOS Mfg.
System Info: Video BIOS Date
Drive where OS loaded from (e.g. "C:")
0 = Non-Terminal Server Client
1 = Terminal Server Client
Current time (e.g. "14:10")
Current 2-digit hour (e.g. "14")
Current 2-digit minutes (e.g. "10")
0 = Non-Terminal Server Client
1 = Terminal Server Client
Logon ID of the user.
Operating System version.build (e.g. " NT Workstation 4.0.1381")
For Windows 95 & 98 clients:
0 = User Profiles are not enabled.
1 = User Profiles are enabled.
The Desktop Authority API functions are designed to streamline your custom scripts by reducing the amount of code you must write. They will also allow you to overcome security limitations of the user.
Description:
Enumerates registry keys into a single dimensional array.
Syntax:
slAEnumKey("RegKey")
Parameters:
RegKey - String, Required
A string that specifies the name of the subkey you want to enumerate from
ReturnValue:
A single dimensional array containing one level of key names.
Description:
Enumerates registry value names into a single dimensional array.
Syntax:
slAEnumValue("RegKey")
Parameters:
RegKey - String, Required
A string that specifies the name of the subkey you want to enumerate the values from.
ReturnValue:
A single dimensional array containing one level of value names.
Description:
Generates alerts (pop-up messages / event log entries) to one or more destinations.
Remarks:
The SMTP e-mail (ToVal=16) is only supported with version 5.5 and newer.
Syntax:
slAlert("Type", "Title", "Text", Timeout, ToVal, "ToDestMsg", "ToDestLog", "ToDestEmail")
Parameters:
Type - String, Required
Type of messagebox to be displayed. Possible single-character types are:
"?" | Question |
"i" | Informational |
"!" | Warning |
"X" | Error |
Title - String, Required
Title of messagebox to be displayed (only applies to client message boxes).
Text - String, Required
Text included in the message/event.
Timeout - Integer, Optional
Timeout of the messagebox (only applies to client message boxes). If 0, there will be no timeout -- the user must press a button to continue.
ToVal - Integer, Optional
An integer representing one or more destinations
1 | Display a pop-up message to the user logging on |
2 | Display a pop-up message to specific user(s) and/or computer(s) |
4 | Write this alert to the client computer’s event log |
8 | Write this alert to the event log on one or more specific computers |
16 | E-mail this alert to specific address(es) |
A combination of destinations can be used by passing the sum of all required destinations.
Example, to display a message to the user and send an email, use a value of 17
ToDestMsg - String, Optional
A string containing one or more destinations (NT-family computers), separated by semicolons {;}, to be used when the $ToVal destination will display a pop-up message to specific user(s) and/or computer(s)
ToDestLog - String, Optional
A string containing one or more destinations (NT-family computers), separated by semicolons {;}, to be used when the $ToVal destination will write an alert to the event log on one or more specific computers.
ToDestEmail - String, Optional
A string containing one or more SMTP E-mail address destinations, separated by semicolons {;}, to mail the alert to.
Note: you must use "@@" in place of a single "@" character within the e-mail address.
ReturnValue:
If the Type is ' ? ', this function returns a value of 6 for the Yes button and 7 for the No button. For all other types, this function returns nothing {0}.
Description:
Sorts the elements of an array.
Syntax:
slASort(array,[order])
Parameters:
Array - Array, Required
The array to perform the operation on.
Order - Boolean, Optional
0 | ascending (default) |
1 | descending |
ReturnValue:
An array or ordered elements.
Description:
Converts a dotted decimal IP address to binary string.
Syntax:
slBinaryIP(IPaddr)
Parameters:
IPaddr - String, Required
IP address in dotted decimal form that you want to convert.
ReturnValue:
A string representing the IP address in binary form.
Description:
Controls the behavior of the [Cancel] button of the active window.
Remarks:
Useful for some 'not so silent' unattended installations.
Syntax:
slCancelButton(Control)
Parameters:
Control - String, Required
Specifying "Hide" or "Disable" will deactivate the ability to press the Cancel button of the active Window.
Specifying "Show" or "Enable" will return the Cancel button to normal operation.
ReturnValue:
Nothing.
Description:
Controls the SL/DA client service's built-in ability to auto-start Explorer upon initialization.
Remarks:
The purpose of auto-starting a hidden instance of Explorer is to perform automatic completion of two-phase software installations, such as Internet Explorer upgrades.
Syntax:
slClientAutoStartExplorer(Control)
Parameters:
Control - String, Required
0 do not launch explorer when the SLclient service starts up 1 auto-start* explorer each and every time the SLclient service starts up 10 auto-start explorer the next time the SLclient service starts up (after that, revert back to 0) 20 force explorer to start the next time the SLclient service starts up (after that, revert back to 0) 21 force explorer to start the next time the SLclient service starts up (after that, revert back to 1) * "Auto-start" will trigger if more values/subkeys are found within HKLM\...\RunOnce or \RunOnceEx keys
upon service startup.
Description:
Generalized base conversion
Syntax:
slCnvtBase(number or array,oldbase,newbase,[NoHex])
Parameters:
Number or Array - Integer, Required
number (base 2-16 only) or array of digits w/MSD in element 0
oldbase - Integer, Required
integer specifying the base of the supplied number
newbase - Integer, Required
integer specifying the base to convert that number to
NoHex - Boolean, Optional
boolean true to use only characters 0-9 for return values
ForceSep - Boolean, Optional
boolean true to always separate digits with colons
ReturnValue:
A string. If highest digit > 9 (or F if HEX allowed), or ForceSep is true, the digits will be delimited with colons
Description:
Compares two IP addresses to determine if they exist on the same network.
Syntax:
slCompareIP($IP1,$IP2,$BitMask)
Parameters:
IP1 - String Required
First IP address to compare
IP2 - String Required
Second IP address to compare
BitMask - Integer Required
BitMask to use in comparison
The subnet mask can be specified in either dotted decimal format or by specifying the number of mask bits. Example: 255.255.255.0 or 24
ReturnValue:
1 IP addresses exist on the same network. 0 IP addresses Do Not exist on the same network.
Description:
Determine if the local computer is in a specific group
Syntax:
slComputerInGroup($group, optional $DomainName)
Parameters:
group - String, Required
Name of group to check
DomainName - String, Optional
Name of the Domain that the group resides in.
ReturnValue:
1 Local computer is a member of group specified 0 Local computer is not a member of group specified
Description:
Create GUID
Syntax:
$NewGuid = slCreateGUID()
ReturnValue:
Returns a globally unique identifier
Description:
Create Unique File
Syntax:
$RC = slCreateUniqueFile($Folder, $Extension)
Parameters:
Folder - String, Optional
Folder to create file in. Defaults to %TEMP%
Extension - String, Optional
Extension to use. Defaults to '.tmp'
ReturnValue:
Filespec of created file or empty string if no file was created.
Description:
Write to the trace file
Remarks:
Writes a string to the sltrace.htm file.
Syntax:
slDebug($LogText, $FontColor)
Parameters:
LogText - String, Optional
String to write to trace file.
FontColor - String, Optional
Font color to use
Description:
Terminates the execution of Desktop Authority.
Syntax:
slEndScript(NoExit)
Parameters:
NoExit - Integer, Optional
If specified as a positive integer, will instruct this function to perform all necessary clean-up procedures, but will not actually terminate Desktop Authority. This can be useful with performing a software installation, where the installation itself will perform a reboot upon completion.
ReturnValue:
Nothing.
Examples:
; Do not run SL on a specific computer.
; For use in a pre-engine custom script.
if @Wksta=' SpecialComputer '
$rc=slEndScript()
endif
Description:
Executes an application, batch or command file.
Remarks:
Extremely powerful and versatile function for use in Custom Scripts.
Syntax:
slExec("program", "program arguments", "function flags")
Parameters:
Program - String, Required
Complete filespec of the Program, batch or command file to execute.
Program Arguments - String, Optional
Optional: Any command line arguments that need to be passed to the Program.
Function Flags - String, Required
Optional: Function Flags control when and how the Program is executed. There are (4) sets of flags that may be used. Choose (1) flag from each set and combine them into a single text string as the third parameter of this function. If the function flag from a given set is not supplied, the default (represented in the table below by an asterisk {*}) will be used. If no function flags are supplied, the program will be executed asynchronously; after the desktop loads; under the current user's security context, and visible. User* Admin Security context when launching the program. User = execute the program as the user logging on. Admin = execute the program with Administrative rights on the local computer. Visible* Hidden Hidden will mask all windows and output generated by the program. This is especially useful when executing console applications, batch or CMD files. During After* Logoff Shutdown When to execute the program: During the logon process, After the logon process completes.
ReturnValue:
Returns any error code generated by launching the program.
Examples:
; Custom Script to update recovery information
; on NT4/2000/XP systems, the first Wednesday of each month at logoff.
;
if @INWIN=1 and @Day='Wednesday' AND @MDAYNO<8
if $OS='NT' and $NtOsVerMajor=4 ; NT 4.0
$rc=slExec('rdisk','/S-','Admin Hidden Logoff')
else
; command line switches for ntbackup are documented in MSKB#Q300439
$rc=slExec('ntbackup','backup systemstate /f "$SystemDrive\SysState.bkf"','Admin Hidden Logoff')
endif
endif
Description:
Compare File Times
Syntax:
slFileTimeCompare($File1, $Comparison, $File2, $Variance)
Parameters:
File1 - String, Required
File Name (including path) of first file
Comparison - String, Required
can be: '<', '<=', '=', '>=', '>', '<>'
File2 - String, Required
File Name (including path) of second file
Variance - String, Optional
Examples:
s3 = a three Second leniency
n5 = a five miNute leniency
h1 = a one Hour leniency
ReturnValue:
-3 = Neither file exists
-2 = $File2 does not exist
-1 = $File1 does not exist
0 = The expression is False
1 = The expression is True
Description:
Get Default Printer
Syntax:
$DP = slGetDefaultPrinter()
ReturnValue:
Name of clients default printer
Description:
List of drives
Syntax:
$Drives = slGetDriveList()
ReturnValue:
returns a list of drives that the computer has
1 Removable
2 Fixed
3 CD/dvd
4 RamDisk
5 Networked drive
Description:
returns the network resource name of the mapped drive or an empty string if not mapped.
Syntax:
$UNC = slGetDriveMap('f')
Parameters:
$DriveLetter - String, Required
Mapped drive letter
ReturnValue:
Returns the network resource name of the mapped drive or an empty string if not mapped.
Description:
Returns the file extension of a given file name
Syntax:
$Ext = slGetFileExt('C:\boot.ini')
Parameters:
FileName - String, Required
Name of file
ReturnValue:
Returns the file extension of a given file name
Description:
Returns filename from a complete path
Syntax:
slGetFileName('FullPath')
Parameters:
FileSpec - String, Required
Complete path of file
ReturnValue:
Returns filename from a complete path
Examples:
$FileName = slGetFileName('c:\winnt\system32\kernel32.dll)
Description:
Extracts the path-only portion of a complete filespec
Syntax:
slGetFilePath('filespec')
Parameters:
FileSpec - String, Required
Full path of a file
ReturnValue:
Path-only portion of a complete filespec
Description:
Get process ID of specified process
Syntax:
slGetProcessID(ProcessName)
Parameters:
$ProcessName - String, Required
Process name to query
ReturnValue:
Returns the PID of the specified process, zero if not found
Description:
Get a list of all running processes
Syntax:
slGetProcessList(1)
Parameters:
$AllUsers - Boolean, Optional
Returns processes for all users rather the current user
ReturnValue:
Returns an array of all running processes for the current user (or all users if $AllUsers=1).
Description:
Get a list of software installed
Syntax:
slGetSoftwareList(1)
Parameters:
$Sort - Boolean, Required
1 = return in sorted order
ReturnValue:
Returns an array of software currently installed (sorted if $Sort=1)
Description:
Manipulate INI files
Parameters:
$Action - String, Required
Possible Actions:
"Del" - Delete
"Write" - Write
$FileSpec - String, Required
Complete file path to INI
$Section - String, Required
Section name you wish to modify
$Value - String, Optional
Value name you wish to modify
$Data - String, Optional
The Data you wish to set to a given $Value
ReturnValue:
An error code if an error was encountered
Description:
Kill a process
Syntax:
slKillProcess(ProcessName)
Parameters:
$ProcessNameOrID - String, Required
can be process name (string) or a process ID (int)
ReturnValue:
Returns 0 on success or a system error code on failure
Description:
Logoff the user
Syntax:
$rc= slLogoff()
Parameters:
NoAlert - Integer, Optional
Suppress the alert associated with logoff.
ReturnValue:
0 = Success
or an error code
Description:
Creates a folder (directory) and/or complete folder structure on disk.
Remarks:
Can be used to create folders on the local computer, mapped network path or UNC network path to a remote computer. When used to create a folder on the local computer, this function can overcome NTFS security restrictions (on the local computer) that
Syntax:
slMakeDir("Folder")
Parameters:
Folder - String, Required
Complete path of the folder to create.
ReturnValue:
Any error associated with performing the action. A return code of 0 (zero) indicates success.
Examples:
$rc=slMakeDir('%WinDir%\Web\Wallpaper')
$rc=slMakeDir('H:\Documents\Word\Backup')
$rc=slMakeDir('\\Server1\Users\'+$UserID+'\Docs')
Description:
Determine the number of times a string exists within a string or an array
Syntax:
$RC = slOccurs("abcabcabc","ab")
Parameters:
$ExpC1 - String, Required
a text string, array element or entire array to search
$Expc2 - String, Required
an expression we are attempting to find within the string or the elements of the array.
ReturnValue:
The total number of occurrences that $ExpC2 was found, or 0 if not found anywhere within the elements of the array.
Description:
Returns the ordinal string of a given number in string form
Syntax:
slOrdinal("13")
Parameters:
$Expr - Integer, Required
Integer from which to generate the returned ordinal string.
ReturnValue:
returns the ordinal string of a given number in string form
Examples:
1=1st, 2=2nd, 3=3rd, 4=4th ... 110th
Description:
Compare two paths
Remarks:
Useful when you are given a mapped drive and a URL, or two shares that point to same physical path
Syntax:
$rc = slPathCompare("L:\Login","\\Server1\Logs\Login")
Parameters:
$Path1 - String, Required
First path to compare (local, mapped or UNC)
$Path2 - String, Required
Second path to compare (local, mapped or UNC)
ReturnValue:
1 if paths are same
0 if paths are different
Description:
Determine if a path is local or mapped.
Parameters:
$Path - String, Required
Path to check
ReturnValue:
1 - If path resides on a local drive
0 - If path does not reside on a local drive
Description:
Ping a machine by Name or IP address
Syntax:
$rc = slPing("10.0.0.1")
Parameters:
$Host - String, Required
Machine name or IP address to ping
ReturnValue:
Returns the classic ping string or an empty string if other than successful.
Description:
Play a wav file
Syntax:
$rc = slPlayWav($Netlogon+"\GoodMorning.wav",1)
Parameters:
$Filespec - String, Required
File spec of wav file to play
$Sync - Integer, Required
0 - Runs aSynchronous
1 - Runs Synchronous
ReturnValue:
Returns 0 on success or a system error code on failure
Description:
Query installed Hotfixes
Remarks:
This function is only supported on the NT-family of products (NT4/2000/XP/etc.)
Syntax:
slQueryHotFix(OPTIONAL $HotFix, OPTIONAL $BCP)
Parameters:
$Hotfix - String, Optional
a specific hotfix to test for
ReturnValue:
If parameter is omitted, a string of all installed hotfixes is returned.
Alternatively, Parameter can be the name of a specific hotfix to test for
If the hotfix is installed, this function returns a numeric 1.
If the hotfix is not installed, this function returns a numeric 0.
Description:
Query installed Internet Explorer hotfixes
Syntax:
$rc = slQueryIEHotFix()
Parameters:
$HotFix - String, Required
Hotfix number to query
ReturnValue:
If parameter is omitted, a string of all installed IE hotfixes is returned.
Alternatively, Parameter can be the name of a specific IE hotfix to test for:
If the IE hotfix is installed, this function returns a numeric 1.
If the IE hotfix is not installed, this function returns a numeric 0.
Description:
Creates a registry key.
Remarks:
The syntax and parameters are similar to KiXtart's built-in AddKey( ) function, with the following exceptions: A [sub]key can be created under any hive and/or key -- regardless of whether or not the user logging on has the privilege to add it.
Syntax:
slRegAddKey("hive\key")
Parameters:
Hive\Key - String, Required
Identifies the hive and [sub]key where you want to create the new key. When specifying the hive, you may use its 'short' or 'long' name: short long HKCU HKEY_CURRENT_USER HKDU HKEY_USERS\.DEFAULT HKLM HKEY_LOCAL_MACHINE HKCR HKEY_LOCAL_MACHINE\Software\Classes (a.k.a. HKEY_CLASSES_ROOT)
ReturnValue:
Any error associated with performing the action. A return code of 0 (zero) indicates success.
Examples:
$rc=slRegAddKey('HKLM\Software\MyKey')
Description:
Deletes a registry key.
Remarks:
A [sub]key can be deleted under any hive and/or key -- regardless of whether or not the user logging on has the privilege to delete it. If the key you are attempting to delete has subkeys beneath it, this function will fail and the keys will not be del
Syntax:
slRegDelKey("hive\key")
Parameters:
Hive\Key - String, Required
Identifies the hive and [sub]key where you want to delete the key. When specifying the hive, you may use its 'short' or 'long' name: short long HKCU HKEY_CURRENT_USER HKDU HKEY_USERS\.DEFAULT HKLM HKEY_LOCAL_MACHINE HKCR HKEY_LOCAL_MACHINE\Software\Classes (a.k.a. HKEY_CLASSES_ROOT)
ReturnValue:
Any error associated with performing the action. A return code of 0 (zero) indicates success.
Examples:
$rc=slRegDelKey($HKLM+'\Software\MyKey')
Description:
Deletes a registry key, including all subkeys.
Remarks:
The keys can be deleted under any hive and/or key. This function should be used with extreme caution!
Syntax:
slRegDelTree("hive\key")
Parameters:
Hive\Key - String, Required
Identifies the hive and [sub]key where you want to delete the key. When specifying the hive, you may use its 'short' or 'long' name:
Short Long
HKCU HKEY_CURRENT_USER
HKDU HKEY_USERS\.DEFAULT
HKLM HKEY_LOCAL_MACHINE
HKCR HKEY_LOCAL_MACHINE\Software\Classes (a.k.a. HKEY_CLASSES_ROOT)
ReturnValue:
Any error associated with performing the action. A return code of 0 (zero) indicates success.
Examples:
$rc=slRegDelTree('HKLM\Software\America Online')
$rc=slRegDelTree('HKCU\Software\America Online')
Description:
Deletes a registry value.
Remarks:
The syntax and parameters are similar to KiXtart's built-in DelValue( ) function, with the following exceptions: Any value within any key can be deleted -- regardless of whether or not the user logging on has the privilege to delete it. To delete
Syntax:
slRegDelVal("hive\key", "value")
Parameters:
Hive\Key - String, Required
Identifies the hive and [sub]key where you want to delete the value.
When specifying the hive, you may use its 'short' or 'long' name:
short long
HKCU HKEY_CURRENT_USER
HKDU HKEY_USERS\.DEFAULT
HKLM HKEY_LOCAL_MACHINE
HKCR HKEY_LOCAL_MACHINE\Software\Classes
(a.k.a. HKEY_CLASSES_ROOT)
Value - String, Required
The name of the entry. To delete the default value of a key, specify "(default)".
ReturnValue:
Any error associated with performing the action. A return code of 0 (zero) indicates success.
Examples:
; Remove the "Copy To" context menu option:
$rc=slRegDelVal($HKCR+'\AllFileSystemObjects\shellex\ContextMenuHandlers\Copy To','(default)')
Description:
A multipurpose function that handles all aspects of the registry.
Syntax:
slRegEdit(Action, Regkey, RegVal, RegExp, RegType, NoDebug)
Parameters:
Action - String, Required
Action to perform on registry. Possible values are:
AddKey
DeleteTree (Should be used with extreme caution!)
DeleteKey
DeleteValue
WriteValue
RegKey - String, Required
Identifies the hive and [sub]key where you want to perform action.
When specifying the hive, you may use its 'short' or 'long' name:
[Short] [Long]
HKCU HKEY_CURRENT_USER
HKDU HKEY_USERS\.DEFAULT
HKLM HKEY_LOCAL_MACHINE
HKCR HKEY_LOCAL_MACHINE\Software\Classes (a.k.a. HKEY_CLASSES_ROOT)
RegVal - String, Optional
The name of the value. To write/read the default value of a key, specify "(default)".
RegExp - String, Optional
The data to store to the value.
To write a blank or null string (effectively erasing the contents of the value), specify "(blank)".
To write a REG_MULTI_SZ data type, use the pipe symbol { | } to separate strings within the data. If the data contains the pipe symbol, represent it using double pipes { || }.
RegType - String, Optional
Type of expression to write.
Examples:
Reg_SZ
Reg_Expand_SZ
Reg_Multi_SZ
Reg_Binary
Reg_DWord
Reg_QWord
NoDebug - Boolean, Optional
0 - show entry in sltrace.htm
1 - do not show entry in sltrace.htm
ReturnValue:
Any error associated with performing the action. A return code of 0 (zero) indicates success.
Examples:
$RC = slRegedit("AddKey","HKLM\Software\Acme")
$RC = slRegedit("DeleteKey","HKLM\Software\Acme")
$RC = slRegedit("WriteValue","HKLM\Software\Acme","DataPath","C:\Acme\Data","Reg_SZ")
Description:
Read a registry value
Remarks:
function slRegReadValue($RegKey,$RegVal)
$slRegReadValue=$SLcom.RegReadValue($RegKey,$RegVal)
endfunction
Syntax:
slRegReadValue(RegKey,RegVal)
Parameters:
$RegKey - String, Required
Key to read
$RegVal - String, Required
Value to read
ReturnValue:
Data of specified Value
Description:
Assigns or changes a registry value.
Remarks:
The syntax and parameters are similar to KiXtart's built-in WriteValue( ) function, with the following exceptions: The data of any value within any key can be changed -- regardless of whether or not the user logging on has the privilege to change it.
Syntax:
slRegWriteVal("hive\key", "value", "data", "data type")
Parameters:
Hive\Key - String, Required
Identifies the hive and [sub]key where you want to write the value. When specifying the hive, you may use its 'short' or 'long' name: short long HKCU HKEY_CURRENT_USER HKDU HKEY_USERS\.DEFAULT HKLM HKEY_LOCAL_MACHINE HKCR HKEY_LOCAL_MACHINE\Software\Classes (a.k.a. HKEY_CLASSES_ROOT)
Value - String, Required
The name of the entry. To write to the default value of a key, specify "(default)".
Data - String, Required
The data to store to the value. To write a blank or null string (effectively erasing the contents of the value), specify "(blank)". To write a REG_MULTI_SZ data type, use the pipe symbol { | } to separate strings within the data. If the data contains the pipe symbol, represent it using double pipes { || }.
Data Type - String, Required
Identifies the data type of the entry. The following data types are supported: REG_NONE REG_SZ REG_EXPAND_SZ REG_BINARY REG_DWORD REG_DWORD_LITTLE_ENDIAN REG_DWORD_BIG_ENDIAN REG_LINK REG_MULTI_SZ REG_RESOURCE_LIST REG_FULL_RESOURCE_DESCRIPTOR
ReturnValue:
Any error associated with performing the action. A return code of 0 (zero) indicates success.
Examples:
; change desktop background color at logon to Windows 2000 blue:
$rc=slRegWriteVal('HKDU\Control Panel\Colors','Background','58 110 165','REG_SZ')
; Create a "Copy To" context menu option:
$rc=slRegWriteVal('HKCR\AllFileSystemObjects\shellex\ContextMenuHandlers\Copy To','(default)','{c2fbb630-2971-11d1-a18c-00c04fd75d13}','REG_SZ')
Description:
Replaces a specified substring within a specified string with a new specified substring and returns the modified string
Parameters:
String - String, Required
The string to be searched.
OldStr - String, Required
The substring you are searching for inside the string
NewStr - String, Optional
The new substring string that you wish to insert inside the string
ReturnValue:
Returns the modified string
Description:
Logs the current user off -or- reboots the computer.
Remarks:
The reboot option is not allowed on servers or domain controllers.
Syntax:
slRestart(Option, NoAlert)
Parameters:
Option - Integer, Required
A numeric value of 1 or the text "Logoff" will logoff the current user. A numeric value of 2 or the text "Reboot" will reboot the computer.
NoAlert - Integer, Optional
Optional: A value of 1 will inhibit the standard Alert (messagebox, eventlog, or message) defined in the Desktop Authority Manager \ Profile Options \ Alerts screen associated with the logging off or rebooting of the computer.
ReturnValue:
Nothing.
Examples:
$rc=slRestart("Logoff",1)
Description:
Send an email
Syntax:
slSendMail("SMTPServer", "SenderAddress", "RecipientAddress", "Subject", "Body")
Parameters:
SMTPServer - String, Required
SMTP server name to use
Sender - String, Required
A string containing an SMTP E-mail address of the sender.
Note: you must use "@@" in place of a single "@" character within the e-mail address.
Recipient - String, Required
A string containing one or more SMTP E-mail address destinations, separated by semicolons {;}
Note: you must use "@@" in place of a single "@" character within the e-mail address.
Subject - String, Required
A string containing the subject of the email.
Body - String, Required
A string containing the body of the email.
FileAttachment - String, Optional
A string containing the full path of to the file to attach to email.
RecipientCC - String, Optional
A string containing one or more SMTP E-mail address destinations to Carbon Copied, separated by semicolons {;}
Note: you must use "@@" in place of a single "@" character within the e-mail address.
RecipientBCC - String, Optional
A string containing one or more SMTP E-mail address destinations to blind carbon copy, separated by semicolons {;}
Note: you must use "@@" in place of a single "@" character within the e-mail address.
ReturnValue:
Returns a system return code. A return code of 0 indicates success.
Description:
Serialize Date Time to perform simple math functions.
Remarks:
Integers can be used for general-purpose math computations on dates
Syntax:
slSerialDateTime($Exp)
Parameters:
$exp - String, Required
Must be a date (in the form of yyyy/mm/dd) or an integer previously derived by this function.
ReturnValue:
If passed a date, it returns an integer.
If passed an integer, it returns the date.
Description:
Changes the display state of the customer-supplied logon graphic.
Remarks:
This function was designed for custom scripting, where a software deployment may not be completely scriptable in quite-mode. When Desktop Authority displays the customer-supplied logo, it is displayed "always on top." This could interfere with certain software
Syntax:
slSetGraphic("mode")
Parameters:
Mode - String, Required
String that specifies the new display state. There are two modes: "Hide" - Stop displaying the graphic. "Show" - Redisplay the graphic.
ReturnValue:
Nothing.
Examples:
$rc=slSetGraphic(' Hide ')
$rc=slSetGraphic(' Show ')
Description:
Set local machine environment variables
Syntax:
$rc = slSetM("MyVar=Hello")
Parameters:
Definition - String, Required
Definition to set
ReturnValue:
Returns standard windows return code
Description:
Configure service startup
Syntax:
slSetServiceStartup($shortname, $startup)
Parameters:
$shortname - String, Required
The short name of the service (same as the registry key)
$startup - Integer, Required
How to configure the service:
0 - Boot
1 - System
2 - Automatic
3 - Manual
4 - Disabled
Description:
Re-defines all Desktop Authority global dynamic variables relating to the location of Windows shell folders.
Remarks:
When Desktop Authority initializes, global dynamic variables are defined. These variables point to the location of the various Windows shell folders
Syntax:
SlSetShellVars( )
Parameters:
New* - Variant, Required
ReturnValue:
Nothing.
Examples:
? 'Current user desktop folder: '+$ShellDesktop
$=writevalue('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders','Desktop','H:\Desktop','REG_SZ')
$=slSetShellVars()
? 'new location of user desktop folder: '+$ShellDesktop
Description:
Creates or removes shortcuts.
Remarks:
Like most Desktop Authority API functions, this function overcomes the normal user's NTFS security restrictions on the local machine - i.e. shortcuts can be created in any folder on the computer they are logging on to.
Syntax:
slShortcut("Action", "Folder", "Name", "Target", "Arguments", "StartIn", "Key", "RunWindow", "Comment", "IconFile", "IconIndex" )
Parameters:
Action - String, Required
Create or Remove the shortcut. Only the first character is evaluated. Use the following table: Add Create Specifying "A", "Add", "C" or "Create" will create a shortcut. If a shortcut by the same name already exists, it will not be overwritten (the new shortcut will not be created). Overwrite Specifying "O" or "Overwrite" will create a shortcut, and will overwrite if necessary, any existing shortcut by the same name. Delete Remove Specifying "D", "Delete", "R" or "Remove" will delete an existing shortcut.
Folder - String, Required
The folder where the shortcut will be created. You can specify the folder as a static string, use a dynamic variable, or combine both. Desktop Authority will automatically create the folder if necessary.
Filename - String, Required
The name of the shortcut. It is not necessary to specify the extension, as this function will automatically assign the proper extension (lnk, pif, url, scf) when the shortcut is created.
Target - String, Optional
The name of the item (program, folder, URL, etc.) that the shortcut will launch. If the shortcut points to an executable file, and the file is not within the Windows search path, the full path to the file should be included, or the folder where the file resides should be specified in the StartIn field.
Note: this field is required when creating shortcuts, however, it is not used when removing shortcuts.
Arguments - String, Optional
The command-line parameters that should be passed to the Target application.
StartIn - String Optional
Specifies the folder that contains the original item or some related files. Sometimes, programs need to use files from other locations. You might need to specify the folder where these files are located so that the program can find them.
Key - String Optional
Specifies the keyboard shortcut that you want press to start or switch to a program. Shortcut keys automatically include CTRL+ALT. You cannot use ESC, ENTER, TAB, the SPACEBAR, PRINT SCREEN, DELETE or BACKSPACE.
RunWindow - String, Optional
Specifies how you want the window to display this item when you open the shortcut: in a standard window, in a full screen ("maximized"), or as a button on the taskbar ("minimized").
Comment - String, Optional
Displays the text description for this shortcut. For desktop shortcuts, the comment will appear in a box when you hover your mouse cursor over the shortcut.
IconFile - String, Optional
Specifies the name of the file that contains the icon for this shortcut. If not specified, the icon embedded within the Target application will be used.
IconIndex - String, Optional
Some files contain more than one icon, and this field allows you to select which icon from the application or icon library will be used. If this field is not specified, the first icon (location 0) will be used.
ReturnValue:
Nothing.
Examples:
$rc=slShortcut('Create', $ShellDesktop, 'My Stuff', 'Explorer.exe', '/e, /n, H:\Documents', '', '', 'Personal documents')
Description:
Creates or removes shortcuts.
Remarks:
Like most API functions, this function overcomes the normal user's NTFS security restrictions on the local machine - i.e. shortcuts can be created in any folder on the computer they are logging on to.
Syntax:
slShortcut("Action", "Folder", "Name", "Target", "Arguments", "StartIn", "Key", "RunWindow", "Comment", "IconFile", "IconIndex" )
Parameters:
Action - String, Required
Create or Remove the shortcut. Only the first character is evaluated. Use the following table: Add Create Specifying "A", "Add", "C" or "Create" will create a shortcut. If a shortcut by the same name already exists, it will not be overwritten (the new shortcut will not be created). Overwrite Specifying "O" or "Overwrite" will create a shortcut, and will overwrite if necessary, any existing shortcut by the same name. Delete Remove Specifying "D", "Delete", "R" or "Remove" will delete an existing shortcut.
Folder - String, Required
The folder where the shortcut will be created. You can specify the folder as a static string, use a dynamic variable, or combine both. Desktop Authority will automatically create the folder if necessary.
Filename - String, Required
The name of the shortcut. It is not necessary to specify the extension, as this function will automatically assign the proper extension (lnk, pif, url, scf) when the shortcut is created.
Target (optional) - String, Optional
The name of the item (program, folder, URL, etc.) that the shortcut will launch. If the shortcut points to an executable file, and the file is not within the Windows search path, the full path to the file should be included, or the folder where the file resides should be specified in the StartIn field.
Note: this field is required when creating shortcuts, however, it is not used when removing shortcuts.
Arguments - String, Optional
The command-line parameters that should be passed to the Target application.
StartIn - String, Optional
Specifies the folder that contains the original item or some related files. Sometimes, programs need to use files from other locations. You might need to specify the folder where these files are located so that the program can find them.
Key - String, Optional
Specifies the keyboard shortcut that you want press to start or switch to a program. Shortcut keys automatically include CTRL+ALT. You cannot use ESC, ENTER, TAB, the SPACEBAR, PRINT SCREEN, DELETE or BACKSPACE.
RunWindow - String, Optional
Specifies how you want the window to display this item when you open the shortcut: in a standard window, in a full screen ("maximized"), or as a button on the taskbar ("minimized").
Comment - String, Optional
Displays the text description for this shortcut. For desktop shortcuts, the comment will appear in a box when you hover your mouse cursor over the shortcut.
IconFile - String, Optional
Specifies the name of the file that contains the icon for this shortcut. If not specified, the icon embedded within the Target application will be used.
IconIndex - String, Optional
Some files contain more than one icon, and this field allows you to select which icon from the application or icon library will be used. If this field is not specified, the first icon (location 0) will be used.
ReturnValue:
Nothing.
Examples:
$rc=slShortcut('Create', $ShellDesktop, 'My Stuff', 'Explorer.exe', '/e, /n, H:\Documents', '', '', 'Personal documents')
Description:
Hide/Show the Start Button
Syntax:
slStartButton($Control)
Parameters:
$Control - String, Required
"Hide" - Hides the start button
"Show" - Shows the start button
"Remove" - Removes the start button (Remove is permanent unless Explorer restarted)
ReturnValue:
a windows return code
Description:
Synchronizes the system clock of the local computer with the system clock of the specified server.
Remarks:
Like most API functions, this function overcomes the normal user's security restrictions - the user does not need the "Change System Time" privilege on the local computer for this function to succeed. When synchronizing time with a Windows NT
Syntax:
slTimeSync("Server")
Parameters:
Server - String, Required
The server you wish to synchronize the client' s clock to, specified in UNC form.
ReturnValue:
Nothing.
Examples:
$rc=slTimeSync('\\MyServer')
$rc=slTimeSync('\\'+$LogonServer)
$rc=slTimeSync('\\192.168.100.11')
Description:
Compare version numbers
Remarks:
If either Ver1 or Ver2 is blank, then it will converted to '0.0.0.0'
Syntax:
$rc = slVersionCompare("4.0.1.1","<","5.1.0.0")
Parameters:
Ver1 - String, Required
First version string to compare
Comparison - String, Required
can be: '<', '<=', '=', '>=', '>', '<>'
Ver2 - String, Required
Second version string to compare
Limit - String, Optional
Limits the number of segments to perform comparison on
If omitted, all segments (up to 4) will be compared
ReturnValue:
1 - comparison evaluates true
0 - comparison evaluates false
'' - not all arguments were properly supplied
Description:
Close an open Windows Firewall port (Windows 7 or greater)
Syntax:
slWinFirewallClosePort( PortNumber, IPProtocol)
Parameters:
$PortNumber - Integer, Required
Port number to close
$IPProtocol - String, Required
Specify what protocol "TCP" or "UDP"
Examples:
$rc = slWinFirewallClosePort( 80, "TCP")
Description:
Enables Windows Firewall (Windows 7 or greater)
Syntax:
slFirewallEnable( enable )
Parameters:
$enable - Boolean, Required
1= enable Windows Firewall
0= disable Windows Firewall
Examples:
$rc = slWinFirewallEnable(1)
$rc = slWinFirewallEnable(0)
Description:
Opens a port in Windows Firewall (Windows 7 or greater)
Syntax:
slWinFirewallOpenPort( Name, PortNumber, LanOnly, IPProtocol, OnlyIfFirewallEnabled)
Parameters:
$Name - String, Required
Name to assign to open port
$PortNumber - Integer, Required
Port number to open
$LanOnly - Boolean, Required
Specifies the scope of the port opening
1= LAN Only
0= Full Network
$IPProtocol - String, Required
Protocol
"TCP"
"UDP"
$OnlyIfFirewallEnabled - Boolean, Required
Opens specified port only if the Windows Firewall is enabled
Examples:
$rc = slWinFirewallOpenPort( "Http", 80, 1, "TCP",0)
Description:
Queries WMI information
Syntax:
slWMIQUery($What,$From,$Computer,$Where,$x)
Parameters:
$what - String, Required
What it is you wish to query
$from - String, Required
Win32 Collection
$computer - String, Optional
defaults to local PC
$where - String, Optional
additional parameter for a 'WHERE' clause. Used with $x
$x - String, Optional
additional parameter for a 'WHERE' clause. Used with $Where
ReturnValue:
Array or @error 1 = Cannot create COM object on target PC
Examples:
$make = WMIQuery("Manufacturer","Win32_ComputerSystem")[0]
$modem = WMIQuery("Description","Win32_POTSModem",$remotePC,"Status","OK")[0]
for each $stick in WMIQuery("Capacity","Win32_PhysicalMemory")
? val($stick) / 1048576
next
Description:
Write ASCII data to log files (Uses the DA Administrative service)
Syntax:
$rc= slWriteLine(LogFileSpec, LogData )
Parameters:
LogFilespec - String, Required
The full UNC to the file to APPEND the data to
LogData - String, Required
The ASCII data you want appended to the file
FunctionFlags - String, Optional
can contain:
'Async' - Desktop Authority will not wait for the write operation to complete before continuing
'NoCrLf' - A CRLF will not be automatically appended to the data written
ReturnValue:
Nothing
Examples:
$rc= slWriteLine("\\Server\Shr\File.log","Hello world")
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Términos de uso Privacidad Cookie Preference Center