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
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
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
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
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
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
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
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
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
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.
24
Loading...
+ 58 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.