The SafeGuard Enterprise Scripting API contains methods supporting the following areas:
Users & Computers management
User-computer assignment (UMA)
Key generation and assignment
Certificate assignment
Token management
Inventory and status information
Challenge/Response
Reporting
Service Accounts
Misc
Prior to using the Scripting API Security Officer authentication is mandatory. Security Officer
authentication is offered by the Scripting API. However, additional authentication (OTS) is not
possible. The authenticated officer must therefore be allowed to perform all required actions on
their own. Authentication can be done once centrally and will be valid for the whole scripting
session.
Events will be logged the same way as if the user was logged on interactively using the
Management Center. Additional events have been defined to reflect the usage of the functionality
by the Scripting API. The Scripting API is exposed through COM registration and can be used by
common scripting languages like VBS.
password, string serverNameIP, string port, int SSL)
DeleteDirectoryConnection(string dsn)
SynchronizeDirectory(string dsn, string adsStartContainer, int
includeSubContainers, string logFilePathName, int membership,
int accountState, int takeCareOfMovedObjects)
GetOneObject(string searchName, string adsStartObject, int filter, out
string adsObject, out string type)
GetObjectInitialize(string searchName, string adsStartObject, int
filter, out int hitCount)
GetObjectByIndex(int index, out string adsObject, out string type)
GetObjectFinalize()
GetMemberOfGroupInitialize(string adsGroup, out int hitCount)
GetMemberOfGroupByIndex(int index, out string adsMember, out string
type)
GetMemberOfGroupFinalize()
CreateUser(string userLogonName, string userFullName, string
adsContainer, out string adsUser)
RenameUser(string adsUser, string newUserFullName, out string
newAdsUser)
DeleteUser(string adsUser)
MoveUser(string adsUser, string adsToContainer, out string newAdsUser)
ServiceAccountListExists (string listName, out int exists)
InitializeServiceAccountLists (out int hitCount)
GetServiceAccountListsByIndex (int index, out string name)
GetServiceAccountMembersByIndex (string listName, int index, out
string username, out string domain)
GetServiceAccountMembersCount (string listName, out int count)
12
Page 14
SafeGuard® Enterprise 5.50, Management API
2 Detailed API Description
2.1 General
2.1.1 Authentication
A Security Officer has to authenticate against SafeGuard Enterprise Scripting.
2.1.2 General methods
Each class in the SafeGuard Enterprise Scripting API has an Initialize() and a FreeResource()
method which needs to be called before and after using the object. The main module (“Base”)
implements a GetLastError method which can be used for advanced error processing.
2.1.3 Enumerating result lists using wildcard search methods
The wildcard search methods are intended to be used for enumerating result lists with multiple
entries.
The initialize function “GetNameInitialized(searchparams, out int hitCount)” creates a result set
of search parameters and a hit count.
The by-index-function “GetNameByIndex(int index, outputparams)” delivers the result at
position index. To show all results, start a loop with an index of 0 (zero) and call the method
repeatedly with an index increased by 1. If the method returns NO_MORE_DATA, the end of the
list has been reached.
The finalize function “GetNameFinalize()” deletes the result set and a new search can be started.
A new initialize function without a finalize function of the old wildcard search returns an error.
2.1.4 Additional permission “Execute Script”
An additional permission for security officers (initially MSO and SO) “Execute Script” has been
introduced. A security officer who is logged on, but does not have this permission, will not be able
to perform any operations using the Scripting API (except Initialize and FreeResources). Like all
other permissions, “Execute Script” can be configured to use additional authentication. In
contrast to operations in the GUI, configuring additional authentication for “Execute Script” will
result in the fact that the script cannot be executed at all as additional authentication is not
supported by the Scripting API!
13
Page 15
SafeGuard® Enterprise 5.50, Management API
2.1.5 “Execute Script” for SafeGuard Enterprise Servers
Scripts can be executed unattendedly on each SafeGuard Enterprise Server. In order to prevent
unauthorized script execution, a SafeGuard Enterprise Server will not have the right “Execute
Script” by default. The MSO needs to explicitly allow script execution for a registered SafeGuard
Enterprise Server.
To allow script execution for a registered SafeGuard Enterprise Server, the MSO has to proceed
as follows:
1. In the menu bar of the SafeGuard Management Center, select Tools > Configuration Package Tool.
2. In tab Register Server, select check box Scripting allowed for the registered SafeGuard
Enterprise Server.
3. Click button Close.
The SafeGuard Enterprise Server now has the right “Execute Script“.
2.2 API for Base
2.2.1 Int32 <each Class>::Initialize()
Initialize() has to be called prior to any other method calls of the object concerned.
2.2.2 Int32 <each Class>::FreeResources()
FreeResources() releases resources needed by the API. Calling FreeResources() on the main
module (“Base”) will release the Security Officer session.
2.2.3 Int32 Base::CreateDirectoryClassInstance ()
Creates a new instance for Directory. This is necessary for using the API for Users & Computers
management and assignment.
2.2.4 Int32 Base::CreateUMAClassInstance()
Creates a new instance for UMA. This is necessary for using the API for user-computer
assignment (UMA).
14
Page 16
SafeGuard® Enterprise 5.50, Management API
2.2.5 Int32 Base::CreateKeysClassInstance()
Creates a new instance for Keys. This is necessary for using the API for key generation and
assignment.
Authenticates the currently logged on user against the SafeGuard Enterprise Scripting API.
Authentication is mandatory prior to using the API.
officerNameName of the officer to be authenticated.
pinOrPasswordEither the password for the certificate store of the logged on
user in case of “no Token” or “Token optional”, or the PIN
of the plugged in token in case of “Token optional” or
“Token mandatory”. The private key required for
authentication must be available in the relevant location
(token or certificate store).
confFilePathNamePath and file name of the .conf file to be used [optional].
Authenticates an officer in a multi tenancy environment. The desired configuration name has to
be provided. Refer to the documentation of Multi Tenancy for further information concerning
configurations. Authentication is mandatory prior to using the API.
officerNameName of the officer to be authenticated.
pinOrPasswordEither the password for the certificate store of the logged on
user in case of “no Token” or “Token optional”, or the PIN
of the plugged in token in case of “Token optional” or
“Token mandatory”. The private key required for
authentication must be available in the relevant location
(token or certificate store).
configurationNameName of the configuration to be used.
Note: SafeGuard Enterprise saves the configurations available
on the system
at:<CSIDL_LOCAL_APPDATA>\Utimaco\SafeGuard
Enterprise\Configuration.
Authenticates Web Helpdesk officers by their P12 file stored in the database.
officerNameName of the officer to be authenticated.
PasswordPassword provided
2.2.17 Int32 Base::AuthenticateService()
Authenticates a service account against the SafeGuard Enterprise Scripting API. Authentication is
mandatory prior to using the API. This method can be used when a script is executed on a
SafeGuard Enterprise Server, where a logged on user is not required.
Note: This method will work on activated SafeGuard Enterprise Servers only. Therefore scripts
using this authentication method will only run on SafeGuard Enterprise Servers, see Installation/
environment on page 80.
All actions performed by the script when using AuthenticateService will be done with the
SafeGuard Enterprise Server SO account which is a Master Security Officer (same user as used by
the SafeGuard Enterprise Web Service).
Creates a new connection to a directory. The connection will be tested immediately and the
process will fail if the connection does not work. The connection will be stored in the SafeGuard
Enterprise database and will also appear in the GUI.
dsnDistinguished name of the directory service to connect to.
userNameUser to be used for connecting to the directory service.
Deletes an existing directory connection from the SafeGuard Enterprise database.
dsnDistinguished name of the directory connection.
18
Page 20
SafeGuard® Enterprise 5.50, Management API
2.3.3 Int32 Directory::SynchronizeDirectory(string dsn,
string adsStartContainer, int includeSubContainers,
string logFilePathName, int membership, int accountState,
int takeCareOfMovedObjects)
Synchronizes a container (optional including subcontainers) with the SafeGuard Enterprise
database.
dsnDistinguished name of the directory connection.
adsStartContainerFull ADS path to the container where the synchronisation
should start from.
includeSubContainers0 = Synchronize only 1st level children of the container (but
no containers).
1 = Include all subcontainers of container.
logFilePathNameFull path and file name of the log file.
membership0 = Without memberships.
1 = Memberships will be synchronized too.
accountState0 = Synchronize the "user enabled" state during 1st
synchronization only.
1 = Always synchronize the "user enabled" state.
int takeCareOfMovedObjects0 = Ignore moved directory objects, even if they were moved
to a container which is also managed by SafeGuard
Enterprise.
1 = Take care of moved objects and synchronize them with
the new container, if the container is managed by
SafeGuard Enterprise.
Note:
If large data amounts are to be synchronized, it is
recommended to set parameter takeCareOfMovedObjects to
0.
Note: If the log file already exists, data will be appended.
Moved containers will be automatically synchronized in the way this is performed by the GUI.
This means, that new containers may appear in the SafeGuard Enterprise database as they include
containers which were moved in the directory service.
As soon as parameter takeCareOfMovedObjects is set to 0, moved containers, users and
machines will be ignored, so they may be deleted including assigned certificates etc.
19
Page 21
SafeGuard® Enterprise 5.50, Management API
2.3.4 Int32 Directory::GetOneObject(string searchName,
string adsStartObject, int filter, out string adsObject, out string type)
Returns an object (machine, user, etc.) in the SafeGuard Enterprise directory. For more than one
object hit, GetOneObject returns an error code.
searchNameSearch name (wildcards * are not allowed).
adsStartObjectFull ADS path to the object where the search should start
from recursively, an empty string for a search in the whole
tree (not for filter = 3).
filterThe type of search, i.e. the type of the result object.
Possible values for filter are:
0 All objects (except local user)
1 Computer
2 User (except local user)
3 Local user
4 Logon name (except local user)
5 Groups
6 Container
7 OU
8 Workgroups
9 Domains
10 Object GUID
Note:
When searching for local users (filter = 3), you have to
specify a start node for adsStartObject.
[out] adsObjectThe ADS path of the object found.
20
Page 22
SafeGuard® Enterprise 5.50, Management API
[out] typeThe type of the object found at the specified index, an empty
string, if no object was found.
Possible values of type are:
userDenotes a user object.
groupDenotes a group object.
computerDenotes a machine object.
containerDenotes a container (not an
organizationalunitDenotes an OU.
domaindnsDenotes a domain node.
s g r o o tD e n o t e s t h e S a f e G u a r d
sgauthmachinegroupDenotes the SafeGuard
sgauthusergroupDenotes the SafeGuard
sgcontainerunknownobjectsDenotes the SafeGuard
OU).
Enterprise specific root
element (exists only once).
Enterprise specific virtual
group “.Authenticated
machines”.
Enterprise specific virtual
group “.Authenticated
users”.
Enterprise specific virtual
group “.Autoregistered”.
21
Page 23
SafeGuard® Enterprise 5.50, Management API
2.3.5 Int32 Directory::GetObjectInitialize(string searchName,
string adsStartObject, int filter, out int hitCount)
Creates a result set of the wildcard search for the object (machine, user, etc.) in the SafeGuard
Enterprise directory.
searchNameSearch name (wildcards * are allowed).
adsStartObjectFull ADS path to the object where the search should start
from recursively,
an empty string for a search in the whole tree (not for filter =
3).
filterThe type of search, i.e. the type of the result object.
Possible values for filter are:
0 All objects (except local user)
1 Computer
2 User (except local user)
3 Local user
4 Logon name (except local user)
5 Groups
6 Container
7 OU
8 Workgroups
9 Domains
10 Object GUID
[out] hitCountCount of all hits in the result set.
22
Page 24
SafeGuard® Enterprise 5.50, Management API
2.3.6 Int32 Directory::GetObjectByIndex(int index, out string adsObject,
out string type)
Returns the object (machine, user, ...) found at a specified index in the SafeGuard Enterprise
directory.
index Index of the child object, zero-based.
[out] adsObjectThe ADS path of the object found at the specified index, an
empty string,
if no object was found.
[out] typeThe type of the object found at the specified index, an empty
string, if no object was found.
Possible values of type are:
userDenotes a user object.
groupDenotes a group object.
computerDenotes a machine object.
containerDenotes a container (not an
OU).
organizationalunitDenotes an OU.
domaindnsDenotes a domain node.
sgrootDenotes the SafeGuard
Enterprise specific root
element (exists only once).
sgauthmachinegroupDenotes the SafeGuard
Enterprise specific virtual
group “.Authenticated
machines”.
sgauthusergroupDenotes the SafeGuard
Enterprise specific virtual
group “.Authenticated
users”.
sgcontainerunknownobjectsDenotes the SafeGuard
Enterprise specific virtual
group “.Autoregistered”.
23
Page 25
SafeGuard® Enterprise 5.50, Management API
2.3.7 Int32 Directory::GetObjectFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
2.3.8 Int32 Directory::GetMemberOfGroupInitialize(string adsGroup,
out int hitCount)
Creates a result set of the wildcard search for the member object of a group in the SafeGuard
Enterprise directory.
adsGroupADS path of the group to retrieve the member objects from.
[out] hitCountThe count of all hits in the result set.
2.3.9 Int32 Directory::GetMemberOfGroupByIndex(int index,
out string adsMember, out string type)
Returns the member object at a specified index of a group in the SafeGuard Enterprise directory.
This method can be used to enumerate group members.
indexIndex of the child object, zero-based.
[out] adsMemberThe ADS path of the member object found at the specified
index. If no member was found, this is an empty string.
[out] typeThe type of object found at the specified index. If no object
was found, this is an empty string.
Possible values of type are:
user Denotes a user object.
group Denotes a group object.
computer Denotes a machine object.
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
Sets an AD Object (only machine, user local user, group) to a SafeGuard Enterprise object.
adsPathADS path of the directory object.
2.3.44 Int32 Directory::ConvertADGuidToSGNGuid(object adGuid,
out string sgnGuid)
Converts an AD GUID into a SafeGuard Enterprise GUID, e.g. as input for set properties
SGD_IMP_ID.
adGuidGUID in Active Directory form.
sgnGuidGUID in SafeGuard Enterprise form.
2.3.45 Int32 Directory::CanSynchronizeDirectory(out int canSynchronize)
Checks, if synchronization can be performed by the API. In case a synchronization process is
currently running (e.g. in a Management Center or in another instance of the API) an attempt to
synchronize the directory will fail.
If the synchronization lock is not reset by the synchronization algorithm automatically (e.g. due
to network problems or system crashes), this function can be used to reset the flag to make
synchronization possible again.
Notice: Do NOT use while a synchronization is running.
Creates a new user-machine assignment in the SafeGuard Enterprise database. For adsUser or
adsMachine a group can also be specified. In this case all direct members (users or computers) of
the relevant group are assigned to the other object.
Deletes an existing user-machine assignment from the SafeGuard Enterprise database. For
adsUser or adsMachine a group can also be specified. In this case the user-machine assignments
for all direct members (users or computers) of the relevant group are deleted.
Gets a UMA property from the SafeGuard Enterprise database.
adsUserADS path of the user object.
adsMachineADS path of the machine object.
propertyIdentifier of the required property.
Possible values of property are:
UMA_LOCK_DOWN 1 = true, 0 = false.
UMA_IS_OWNER 1 = true, 0 = false.
UMA_DENY_OWNERSHIP 1 = true, 0 = false.
[out] valueValue of the property (string representation).
2.4.5 Int32 UMA::GetUMAOfUserInitialize(string adsUser, out int hitCount)
Creates a result set of the wildcard search for the machine which is assigned to a user from the
SafeGuard Enterprise directory.
adsUserADS path of the user.
[out] hitCountCount of all hits in the result set.
2.4.6 Int32 UMA::GetUMAOfUserByIndex(int index, out string adsMachine)
Returns the machine at the specified index which is assigned to a user from the SafeGuard
Enterprise database. This method can be used for enumerating the machines of a user.
indexIndex of the machine object, zero-based.
[out] adsMachineADS path of the machine found at the specified index.
If no object was found, this is an empty string.
2.4.7 Int32 UMA::GetUMAOfUserFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
40
Page 42
SafeGuard® Enterprise 5.50, Management API
2.4.8 Int32 UMA::GetUMAOfMachineInitialize(string adsMachine,
out int hitCount)
Creates a result set of the wildcard search for the user who is assigned to a machine from the
SafeGuard Enterprise directory.
adsMachineADS path of the machine.
[out] hitCountCount of all hits in the result set.
Returns the user at the specified index who is assigned to a machine from the SafeGuard
Enterprise database. This method can be used for enumerating the users of a machine.
indexIndex of the user object, zero-based.
[out] adsUserADS path of the user found at the specified index.
If no object was found, this is an empty string.
2.4.10 Int32 Directory::GetUMAOfMachineFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
41
Page 43
SafeGuard® Enterprise 5.50, Management API
2.5 API for key generation and assignment
2.5.1 Int32 Keys::CreateKey (string adsObject, string desiredName,
string binaryValue, out string symbolicName, out string keyId)
Creates a new key in the SafeGuard Enterprise database. The user has to provide a desired name,
which will be converted and potentially changed to the symbolic name of the key.
adsObjectADS path of the object (no computer allowed) to assign the
new key to.
desiredNameDesired/initial name for the key (e.g. OU_SGEnterprise).
binaryValue[optional]
Binary value of the key, random key if empty ("").
[out] symbolicNameSymbolic name created (e.g. OU_SGEnterprise_8).
[out] keyIdID of the key created (e.g. 0x2E87A…).
2.5.2 Int32 Keys::GetKeyBySymbolicNameInitialize(string symbolicName,
out int hitCount)
Creates a result set of the wildcard search for keys in the database which match the symbolic name
provided.
symbolicNameSymbolic name to search for.
[out] hitCountCount of all hits in the result set.
2.5.3 Int32 Keys::GetKeyBySymbolicNameByIndex(int index, out string keyId)
Searches for keys in the database which match the symbolic name provided. Returns the key ID
from the specified index.
indexIndex in hit list.
[out] keyIdID of the key found at the specified index.
42
Page 44
SafeGuard® Enterprise 5.50, Management API
2.5.4 Int32 Keys::GetKeyBySymbolicNameFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
2.5.5 Int32 Keys::GetKeyByIdInitialize(string keyId, out int hitCount)
Creates a result set of the wildcard search for keys in the database which match the key ID
provided.
keyIdKey ID to search for.
[out] hitCountCount of all hits in the result set.
2.5.6 Int32 Keys::GetKeyByIdByIndex(int index, out string keyId,
out string keyName)
Searches for keys in the database which match the symbolic name provided. Returns the key ID
and name at the specified index.
indexIndex in hit list.
[out] keyIdID of the key found at the specified index.
[out] keyNameName of the key found at the specified index.
2.5.7 Int32 Keys::GetKeyByIdFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
adsObjectADS path of the object to detach the key from.
keyIdID of the key to detach.
44
Page 46
SafeGuard® Enterprise 5.50, Management API
2.5.12 Int32 Keys::GetAssignedKeyInitialize(string adsObject, out int hitCount)
Creates a result set of the wildcard search for keys in the database which are assigned to a specific
object.
adsObjectADS path of the object.
[out] hitCountThe count of all hits in the result set.
2.5.13 Int32 Keys::GetAssignedKeyByIndex(int index, out string keyId)
Searches for keys of a type in the database which are assigned to a specific object. Returns the key
ID from the specified index.
indexIndex in hit list.
[out] keyIdID of the key found at the specified index.
2.5.14 Int32 Keys::GetAssignedKeyFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
2.5.15 Int32 Keys::GetAssignedObjectInitialize(string keyId, out int hitCount)
Creates a result set of the wildcard search for objects in the database to which a specific key is
assigned.
keyIdID of the key.
[out] hitCountCount of all hits in the result set.
45
Page 47
SafeGuard® Enterprise 5.50, Management API
2.5.16 Int32 Keys::GetAssignedObjectByIndex(int index, out string adsObject)
Searches for objects in the database to which a specific key is assigned. Returns the ADS path of
the object from the specified index
indexIndex in hit list.
[out] adsObjectADS path of the object at the specified index.
2.5.17 Int32 Keys::GetAssignedObjectFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
Internally creates a certificate and assigns it to an existing user.
adsUserADS path of the user.
passwordThe user's password.
46
Page 48
SafeGuard® Enterprise 5.50, Management API
Note: For this function, the user's password has to be provided. Typically, this is the Windows
password which may not be available to the caller.
2.6.3 Int32 Certificates::GetCertOfUserInitialize(string adsUser,
out int hitCount)
Creates a result set of the wildcard search for the certificate which is assigned to a user from the
SafeGuard Enterprise database.
adsUserADS path of the user.
[out] hitCountCount of all hits in the result set.
2.6.4 Int32 Certificates::GetCertOfUserByIndex(int index, out string certId)
Returns the certificate at the specified index which is assigned to a user from the SafeGuard
Enterprise database. This method can be used to enumerate the certificates of users.
IndexIndex of the certificate object, zero-based.
[out] certIdCertificate identifier (at the specified index).
Can be used as input parameter for GetCertInfo().
2.6.5 Int32 Certificates::GetCertOfUserFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
47
Page 49
SafeGuard® Enterprise 5.50, Management API
2.6.6 Int32 Certificates::GetUserOfCertInitialize(string subject, string issuer,
string serial, out int hitCount)
Creates a result set of the wildcard search for the user to whom the certificate is assigned in the
SafeGuard Enterprise database.
subjectSubject of the certificate to query for.
issuerIssuer of the certificate to query for.
serialSerial number of the certificate to query for.
[out] hitCountCount of all hits in the result set.
2.6.7 Int32 Certificates::GetUserOfCertByIndex(int index, out string adsUser)
Returns the user at the specified index to whom the certificate is assigned in the SafeGuard
Enterprise database. This method can be used to enumerate users to whom a specific certificate is
assigned.
indexIndex of the user object.
[out] adsUserUser object at the specified index.
2.6.8 Int32 Certificates::GetUserOfCertFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
Removes the assignment of a certificate to a user in the database.
adsUserADS path of the desired user.
certIdID of the certificate.
2.6.11 Int32 Certificates::GetCertInfo(string certId, out string subject,
out string issuer, out string serial, out string startDate,
out string endDate)
Retrieves certificate properties of a certificate specified by its certificate ID.
certIdCertificate ID to query for.
subjectSubject of the certificate (empty string, if not found).
issuerIssuer of the certificate (empty string, if not found).
serialSerial number of the certificate (empty string, if not found).
startDateStart date of the certificate (string representation mm/dd/
yyyy).
endDateExpiry date of the certificate (string representation mm/dd/
Renews a certificate in the database by the time it is configured in the SafeGuard Management
Center (Tools menu > Options). Only certificates created by SafeGuard Enterprise - either
automatically by the server or by CreateAndAssignCertForUser() - can be renewed. Otherwise,
this function will fail.
For this function, the user's password has to be provided. Typically, this is the Windows password
which may not be available to the caller.
certIdCertificate ID of the certificate to be renewed.
passwordPassword of the certificate to be renewed.
serialSerial number of the certificate to be deleted.
2.6.19 Int32 Certificates::DeleteAllCACerts()
Deletes all CA certificates from the database.
2.7 API for token management
2.7.1 Int32 Token::GetSlotIdInitialize(out int hitCount)
Creates a result set of the wildcard search for the slot ID of the token slot.
A slot ID is required for SetUsedSlot, which has to be called in order to be able to perform token
operations.
[out] hitCountCount of all hits in the result set.
2.7.2 Int32 Token::GetSlotIdByIndex(int index, out int slotId)
Returns the slot ID of the token slot at the specified index. This function can be used to enumerate
token slots.
indexIndex of the slot list.
[out] slotIdSlot ID from specified index.
51
Page 53
2.7.3 Int32 Token::GetSlotIdFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
2.7.4 Int32 Token::SetUsedSlot(int slotId)
Selects the slot for further token operations.
Note: The slot ID has to be selected prior to any other calls which affect a token
slotIdSlot ID to be used for follow-up operations.
SafeGuard® Enterprise 5.50, Management API
2.7.5 Int32 Token::GetSlotInfo(out string description, out string manufacturer,
out int flags, out string hwVersion, out string fwVersion)
Retrieves information about the currently selected token slot.
[out] descriptionDescription of the slot (e.g. reader name).
[out] manufacturerManufacturer (e.g. Omnikey).
[out] flagsFlags according to PKCS11.
[out] hwVersionHardware version number.
[out] fwVersionFirmware version number.
2.7.6 Int32 Token::GetTokenInfo(out string label, out string manufacturer,
out string model, out string serial, out string hwVersion,
out string fwVersion)
Retrieves information about the token in the currently selected token slot.
[out] labelLabel of the token.
[out] manufacturerManufacturer of the token.
[out] modelToken model information string.
[out] serialToken serial number.
[out] hwVersionHardware version number.
52
Page 54
SafeGuard® Enterprise 5.50, Management API
[out] fwVersionFirmware version number.
2.7.7 Int32 Token::TokenPresent(out int isPresent)
Checks, if a token has been plugged in the slot currently selected.
Completely deletes the SafeGuard Enterprise data stored on the token. Certificates will not be
affected by this function. When Security Officer PIN and user PIN are provided, the user PIN will
be set to newUserPIN. If no Security Officer PIN is provided, the value given in newUserPIN is
used for token logon.
SOPINSecurity Officer PIN [optional].
newUserPINEither the current user PIN of the token or the new user PIN
Issues a token for a user in the SafeGuard Enterprise directory. User credentials must have been
configured for the user and USR_TOKEN_ISSUE_CREDENTIALS must be set to 1. If Security
Officer PIN and user PIN are provided, the user PIN will be set to newUserPIN. If no Security
Officer PIN is provided, the value given in newUserPIN is used for token logon.
adsUserADS path of the user for whom the token is to be issued.
userPINEither the current user PIN of the token or the new user PIN
for the token.
SOPINSecurity Officer PIN [optional].
2.7.16 Int32 Token::GetSGNCredentials(string userPIN, out string userName, out
string domain)
Retrieves the SafeGuard Enterprise credentials currently stored on the plugged in token.
SafeGuard Enterprise credentials will be used for logon in case of non-cryptographic tokens.
userPINUser PIN of the token.
[out] userNameUser name stored on the token.
[out] domainDomain information stored on the token.
Writes the SafeGuard Enterprise credentials to the plugged in token. SafeGuard Enterprise
credentials will be used for logon in case of non-cryptographic tokens.
userPINUser PIN of the token.
userNameUser name.
password(Windows) password.
domainDomain information.
Note: It is not recommended to use this function as the user/token assigment is not stored in the
database.
In this case, use IssueTokenForUser() instead.
All parameters can be empty. This will cause the SafeGuard Enterprise credentials to be removed
from the token.
Retrieves the user the token was issued for using IssueTokenForUser().
[out] adsAssignedUserADS path of the user for whom the token was issued.
2.7.19 Int32 Token::GetAssignedTokensInitialize(string adsUser,
out int hitCount)
Creates a result set of the wildcard search for serial numbers of tokens which were issued for a
specific user.
adsUserADS path of the user to query for issued tokens.
[out] hitCountCount of all hits in the result set.
2.7.20 Int32 Token::GetAssignedTokensByIndex(int index, out string serial)
Retrieves serial numbers of tokens at the specified index which were issued to a specific user.
indexIndex in list of assigned tokens.
[out] serialSerial number from index.
56
Page 58
SafeGuard® Enterprise 5.50, Management API
2.7.21 Int32 Token::GetAssignedTokensFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
2.7.22 Int32 Token::EnableDisableTokenInDB(string tokenSN, int enable)
Enables or disables a token which is stored in the issued tokens table. All disabled tokens form the
"Token Blacklist" which will be replicated to the clients. Disabled tokens cannot be used to log on.
Searches for a certificate on the token and (if found) deletes it from the token.
userPINUser PIN for the plugged in token.
subjectCertificate subject to search for.
issuerCertificate issuer to search for.
serialCertificate serial number to search for.
2.7.26 Int32 Token::GetCertFromTokenInitialize(out int hitCount)
Creates a result set of the wildcard search for properties of certificates found on the plugged in
token.
[out] hitCountCount of all hits in the result set.
2.7.27 Int32 Token::GetCertFromTokenByIndex(int index, out string subject, out
string issuer, out string serial, out string expiryDate)
Returns properties of certificates found on the plugged in token at the specified index.
indexIndex of the certificate on the token.
[out] subjectCertificate subject.
[out] issuerCertificate issuer.
[out] serialCertificate serial number.
[out] expiryDateCertificate expiry date (dd/mm/yyyy), string representation.
2.7.28 Int32 Token::GetCertFromTokenFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
Creates a key pair/certificate by the plugged in token.
The private key cannot be exported. The key pair is stored in a self-signed certificate. The token
must be able to handle keys with the desired key length.
userPINUser PIN of the plugged in token.
subjectCertificate subject.
serialCertificate serial number.
keylengthDesired key length of the RSA key pair (allowed values: 1024,
Searches for a certificate on the token and (if found) exports the certificate (P7) to a file.
subjectCertificate subject to search for.
issuerCertificate issuer to search for.
serialCertificate serial number to search for.
filePathP7Path and file name for the certificate file to be created.
Notice: Existing files will be overwritten without warning.
59
Page 61
SafeGuard® Enterprise 5.50, Management API
2.8 API for inventory and status information
2.8.1 Int32 Inventory::GetComputerInventory(string adsMachine,
string property, out string propertyValue, out string propertyString)
Retrieves an inventory property for a machine from the database (machine inventory).
adsMachineADS path of the machine to retrieve the inventory property
from.
propertyProperty name.
[out] propertyValueInventory value from database.
Values for property are defined as:
MachineName
LastPolicyReceived
EncryptedDrives
UnencryptedDrives
OperatingSystem
POA
POAType
WOL
Attack
ModificationDate
ParentDSN
[out] propertyStringValue of the desired property (string representation).
60
Page 62
SafeGuard® Enterprise 5.50, Management API
2.8.2 Int32 Inventory::GetDriveInventory(string adsMachine, string driveId, string
property, out string propertyValue, out string propertyString)
Retrieves a drive inventory property for a machine from the database.
adsMachineADS path of the machine to get the drive inventory property
from.
driveIdDrive ID (from GetDriveInventoryIdByIndex()).
propertyProperty name.
[out] propertyValueInventory value from database, property values are defined as:
DriveName
Type
State
Algorithm
[out] propertyStringValue of the desired property (string representation).
2.8.3 Int32 Inventory::GetDriveInventoryIdInitialize(string adsMachine,
out int hitCount)
Creates a result set of the wildcard search for drive inventory IDs.
adsMachineADS path of the machine.
[out] hitCountCount of all hits in the result set.
2.8.4 Int32 Inventory::GetDriveInventoryIdByIndex(int index,
out string driveId)
Gets a drive inventory ID from the specified index. This function can be used to enumerate drive
IDs of the inventory of a specific machine.
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
2.8.6 Int32 Inventory::GetUserInventory(string adsMachine, string adsUser,
string property, out string propertyValue, out string propertyString)
Retrieves a user inventory property for a machine from the database.
adsMachineADS path of the machine to get the software inventory
property from.
adsUserADS path of the user.
propertyProperty name.
[out] propertyValueInventory value from database, property values are defined
as:
UserName
UserIsOwner
[out] propertyStringValue of the required property (string representation).
2.8.7 Int32 Inventory::GetUserInventoryAdsInitialize(string adsMachine,
out int hitCount)
Creates a result set of the wildcard search for the user ADS path of a machine's user inventory.
adsMachineADS path of the machine.
[out] hitCountCount of all hits in the result set.
62
Page 64
SafeGuard® Enterprise 5.50, Management API
2.8.8 Int32 Inventory::GetUserInventoryAdsByIndex(int index,
out string adsUser)
Gets a user ADS path from the specified index of a machine's user inventory. This function can
be used to enumerate the users of the inventory of a specific machine.
indexIndex in hit list.
[out] adsUserUser ADS path at the specified index.
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
2.8.10 Int32 Inventory::GetFeatureInventory(string adsMachine,
string moduleName, string property, out string propertyValue,
out string propertyString)
Retrieves a feature inventory property for a machine from the database.
adsMachineADS path of the machine to retrieve the feature inventory
property from.
moduleNameModule name of the feature.You can retreive a module name
from the inventory of a specific name by using Int32
Inventory::GetFeature
InventoryModuleByIndex(int index, out string
moduleName.
For details see Int32
Inventory::GetFeatureInventoryModuleByIndex(int index, out
string moduleName) on page 64.
propertyProperty name
[out] propertyValueInventory value from the database.
The values for property are defined as:
ModuleName
Version:
63
Page 65
SafeGuard® Enterprise 5.50, Management API
[out] propertyStringInventory value from the database as string representation
(with no special string representation identical to
propertyValue)
2.8.11 Int32 Inventory::GetFeatureInventoryModuleInitialize(string adsMachine,
out int hitCount)
Creates a result set of the wildcard search for the module name of a machine’s feature inventory.
adsMachineADS path of the machine.
[out] hitCountCount of all hits in the result set.
2.8.12 Int32 Inventory::GetFeatureInventoryModuleByIndex(int index,
out string moduleName)
Retrieves a module name from the specified index of a machine’s feature inventory. This function
can be used to enumerate features of the inventory of a specific machine.
indexIndex in hit list.
[out] moduleNameModule name from the specified index.
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
64
Page 66
SafeGuard® Enterprise 5.50, Management API
2.9 API for Challenge/Response
2.9.1 Int32 CR::CheckRecoveryType(string adsMachine, out int isLogon)
Checks the recovery type for a machine (logon recovery or BitLocker).
adsMachineADS path for the machine from which the challenge was sent.
[out] isLogon1 = logon recovery, 0 = BitLocker.
2.9.2 Int32 CR::GetChallengeFlags(string adsMachine, string challenge,
out int challengeFlags)
Extracts the action flags from a challenge and returns them.
adsMachineADS path for the machine from which the challenge was sent.
challengeChallenge received from user.
[out] challengeFlagsFlags contained in the challenge.
Flags are defined as:
1 Boot SafeGuard Enterprise client without user logon
requested.
2 Flush of SafeGuard Enterprise local cache expected.
4 Boot from external medium or floppy disk requested
8 Crypto token requested
Flag combinations in challengeFlags are possible.
65
Page 67
SafeGuard® Enterprise 5.50, Management API
2.9.3 Int32 CR::CheckChallenge(string challenge, out int challengeErrorPart)
Checks the challenge and returns the state in challengeErrorPart.
challengeChallenge received from user.
[out] challengeErrorPartState of the challenge.
The values for challengeErrorPart are defined as:
1 Error in the first part of the challenge (character 1 to 10).
2 E rr or in th e secon d part of the challe nge (char acter 11 to
20).
3 Error in the third part of the challenge (character 21 - 30).
9 Wrong challenge length.
2.9.4 Int32 CR::ComputeResponse(string adsUser, string adsMachine,
string challenge, int action, out string response)
Calculates and returns a response for a given challenge.
adsUserADS path of the user requesting the response [optional].
adsMachineADS path of the machine on which the challenge was created.
challengeChallenge string.
actionFlags defining which action will be performed on the client.
Actions are defined as:
0 Boot SafeGuard Enterprise client with user logon
(without showing user password).
1 Boot SafeGuard Enterprise client with user logon
(showing user password).
2 Boot SafeGuard Enterprise client without user logon.
3 Allow booting from external medium.
[out] responseResponse code string.
66
Page 68
SafeGuard® Enterprise 5.50, Management API
2.9.5 Int32 CR::BitLockerRecovery(string adsMachine, string drive,
out string response)
Calculates the response for BitLocker.
adsMachineADS path of the machine on which the challenge was created.
driveDrive requesting the response, empty for BitLocker Boot.
[out] responseResponse code string.
2.9.6 Int32 CR::OfflineCheckBAKFile(string bakFileName, out int isLogon,
out string drive)
Checks the BAK file of an offline client (Logon recovery or BitLocker).
bakFileNamePath of the BAK file of the offline client.
[out] isLogon1 = logon recovery, 0 = BitLocker.
[out] driveRequesting the response for BitLocker drive, empty for
BitLocker BOOT.
2.9.7 Int32 CR::OfflineGetChallengeFlags(string bakFileName,
string challenge, out int challengeFlags)
Extracts the action flags from a challenge and returns them for an offline client.
bakFileNamePath of the BAK file of the offline client.
challengeChallenge received from user
[out] challengeFlagsFlags contained in the challenge.
Flags are defined as:
1 Boot SafeGuard Enterprise client without user logon
requested.
2 Flush of SafeGuard Enterprise local cache expected.
4 Boot from external medium or floppy disk requested
8 Crypto token requested
Flag combinations in challengeFlags are possible.
67
Page 69
SafeGuard® Enterprise 5.50, Management API
2.9.8 Int32 CR::OfflineComputeResponse(string bakFileName,
string challenge, int action, out string response)
Calculates and returns a response for a given challenge for an offline client.
bakFileNamePath of the BAK file of the offline client.
challengeChallenge string.
actionFlags defining which action will be performed on the client.
Actions are defined as:
0 Boot SafeGuard Enterprise client with user logon
(without showing user password).
1 Boot SafeGuard Enterprise client with user logon
(showing user password).
2 Boot SafeGuard Enterprise client without user logon.
3 Allow booting from external medium.
[out] responseResponse code string.
2.9.9 Int32 CR::OfflineBitLockerRecovery(string bakFileName, string drive, out
string response)
Calculates the response for BitLocker for an offline client.
bakFileNamePath of the BAK file from the offline client.
driveDrive requesting the response, empty for BitLocker BOOT.
[out] responseResponse code string.
2.9.10 Int32 CR::GetVirtualClientInitialize(string searchName, out int hitCount)
Creates a result set of the wildcard search for virtual clients in the SafeGuard Enterprise database.
searchNameSearch name of the virtual client.
[out] hitCountThe count of all hits in the result set.
68
Page 70
SafeGuard® Enterprise 5.50, Management API
2.9.11 Int32 CR::GetVirtualClientByIndex(int index,
out string virtualClientName, out string virtualClientId)
Returns the virtual client at the specified index from the SafeGuard database.
indexIndex of the certificate object, zero-based.
[out] virtualClientNameName of the virtual client.
[out] virtualClientIdID of the virtual client
2.9.12 Int32 CR::GetVirtualClientFinalize()
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
2.9.13 Int32 CR::GetVirtualClientKeyFileInitialize(string searchName,
out int hitCount)
Creates a result set of the wildcard search for virtual client key files in the SafeGuard Enterprise
database.
searchNameSearch name of the virtual client key files.
[out] hitCountCount of all hits in the result set.
2.9.14 Int32 CR::GetVirtualClientKeyFileByIndex(int index,
out string keyFileName, out string keyFileComment)
Returns the virtual client key file at the specified index from the SafeGuard Enterprise database.
indexIndex of the certificate object, zero-based
[out] keyFileNameName of the virtual client key file.
[out] keyFileCommentComment of the virtual client key file.
Finalizes the wildcard search and deletes the result set. A new search can be started.
Note: You have to call the finalize function to be able to start a new search. Calling a new initialize
function without calling the finalize function of the old wildcard search first, results in error code
ACTION_NOT_FINALIZED.
Calculates and returns a response for a given challenge for a virtual client with a key file. Deletes
the key file after sucessful creation of the response.
2.12.11 Int32 ServiceAccountExists(string listName, string name, string domain,
out int exists)
Checks whether a service account exists or not.
listNameName of the service account list
nameThe name of the service account that is to be checked.
domainThe domain of the service account
[out] exists 1 = The service account exists.
0 = The service account does not exist.
76
Page 78
SafeGuard® Enterprise 5.50, Management API
2.12.12 Int32 ServiceAccountListExists(string listName, out int exists)
Checks whether a service account list exists or not.
listNameThe name of the service account list that is to be checked.
[out] exists 1 = The service account list exists.
0 = The service account list does not exist.
2.13 Error codes returned by the API methods
OBJECT_OWN_MEMBER = -15
ACTION_NOT_FINALIZED = -14
ACTION_NOT_INITIALIZED = -13
RESULT_NOT_UNIQUE = -12
INVALID_CHALLENGE_CODE = -11
NO_MORE_DATA = -10
INSUFFICIENT_RIGHTS = -9
CONFIG_FILE_ERROR = -8
TOKEN_INVALID_SLOT = -7
NOT_AUTHENTICATED = -6
OBJECT_NOT_FOUND = -5
OBJECT_ALREADY_EXISTS = -4
TOKEN_NOT_PRESENT = -3
NOT_INITIALIZED = -2
Object cannot be its own member.
For example: a group cannot be its own member.
Action (e.g. wildcard search) not finalized.
Action (e.g. wildcard search) not initialized.
Result set is not unique.
Wrong challenge code entered for Challenge/
Response.
End of data in any wildcard search method.
Current Security Officer has insufficient rights.
.conf file could not be found or is invalid.
Invalid token slot ID.
Security Officer has not authenticated.
Object not found in the database.
Object already exists.
No token in the slot.
API was not initialized.
77
FAILURE = -1
OK = 0
General failure.
Success.
Note: As soon as an error is returned by the API, the user can call GetLastError to receive a
more detailed error message along with the internal error code. Note that the error message string
will be localized.
Page 79
SafeGuard® Enterprise 5.50, Management API
2.14 Additional log events
Additional log events have been defined. The events are logged when the Scripting API is used:
2.15 Format of the log file created during synchronization
Basically, the log file created during synchronization will be written in comma-separated values
(*.csv).
2.16 Sample scripts
The SafeGuard Enterprise Administration Product CD contains sample scripts for all main areas.
You will find the sample scripts in directory \samples on this CD. The following sample scripts are
available:
AreaSample script file
SynchronizationSynchronize.vbs
Users & Computers managementAddObjectToSGN.vbs
User-computer assignment (UMA)UmaAPI.vbs
Key generation and assignmentKeyGenerationAssignmentAPI.vbs
Certificate assignmentCertificatesAPI.vbs
Token managementTokenSampleScript.vbs
Inventory and status informationInventoryAPI.vbs
Challenge/ResponseChallengeResponseByScript.vbs
ReportingReportsAPI.vbs
78
Page 80
SafeGuard® Enterprise 5.50, Management API
For running WSH scripts you should always use Cscript.exe Interpreter (by default scripts are run
using Wscript.exe). Using Cscript Interpreter, the WSH script is run within a command shell
(CMD). This avoids for example a message box being displayed at Wscript echo output, which
you have to close by mouse click. Furthermore, using Cscript facilitates the detection of
programming errors. You can cancel scripts simply by closing the command shell or pressing Ctrl
+ C. Cscript Interpreter also facilitates running simple scripts (e.g. Schedule) automatically at a
specified point in time.
Following is an example for running scripts via Cscript:
1. Select Start > Run and enter command
2. In the window displayed, use command
where the WHS is stored.
3. Call the script using command
cscript (e.g. cscript Synchronize.vbs).
cmd.
cd (change directory) to change to the directory,
79
Page 81
SafeGuard® Enterprise 5.50, Management API
3 Installation/environment
A script which is executed in a user context can be run on the Security Officer’s machine, where
the SafeGuard Enterprise Management Center is installed. The Management Center has to be
configured (Initial Configuration Wizard) and operable.
When a script is executed unattended on a SafeGuard Enterprise Server, this requires an activated
SafeGuard Enterprise Server (Server Package installed). However, the Web Service itself can be
deactivated after it has been tested for successful operation.
The API DLL is called “Utimaco.SafeGuard.AdministrationConsole.Scripting.dll”. It is installed
in the .NET Global Assembly Cache (GAC) along with the Management Center Setup.
80
Page 82
1 Technical Support
You can find technical support for Sophos products in any of these ways:
Visit the SophosTalk forum at http://community.sophos.com/ and search for other users who
are experiencing the same problem.
Visit the Sophos support knowledgebase at http://www.sophos.com/support/
Download the product documentation at http://www.sophos.com/support/docs/
Send an email to support@sophos.com, including your Sophos software version number(s),
operating system(s) and patch level(s), and the text of any error messages.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any
form or by any means, electronic, mechanical, photocopying, recording or otherwise unless you
are either a valid licensee where the documentation can be reproduced in accordance with the
licence terms or you otherwise have the prior permission in writing of the copyright owner.
Sophos is a registered trademark of Sophos Plc and the Sophos Group. SafeGuard is a registered
trademark of Utimaco Safeware AG - a member of the Sophos Group. All other product and
company names mentioned are trademarks or registered trademarks of their respective owners.
All SafeGuard products are copyright of Utimaco Safeware AG - a member of the Sophos Group,
or, as applicable, its licensors. All other Sophos products are copyright of Sophos plc., or, as
applicable, its licensors.
You will find copyright information on third party suppliers in the file entitled Disclaimer and
Copyright for 3rd Party Software.rtf in your product directory.
82
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.