GetAuditStore method
Retrieves an audit store given its display name.
Syntax
AuditStore class GetAuditStore(
string Name
)
Parameters
Specify the following parameter when using this method.
Parameter | Description |
name |
The display name of the audit store database. |
Errors
The GetAuditStore
method may throw one of the following exceptions:
Centrify.DirectAudit.Common.Logic.AuthenticationException
if you do not have permission to connect to the Microsoft SQL Server instance or the management database.Centrify.DirectAudit.Common.Logic.ConnectDatabaseException
if you cannot connect to the Microsoft SQL Server instance either because the Microsoft SQL Server instance is not running and does not allow remote connections.
Example
The following code sample accepts the audit store display name as an argument when the script is executed, calls the GetAuditStore
method to get the audit store, then attaches a new audit store database to the audit store:
... strInstallationName = wscript.arguments.item(0) strAuditStoreName = wscript.arguments.item(1) strServerName = wscript.arguments.item(2) strDatabaseName = wscript.arguments.item(3) SET objConnection = CreateObject("Centrify.DirectAudit.Connection") SET objInstallation = objConnection.GetInstallation(strInstallationName) SET objAuditStore = objInstallation.GetAuditStore(strAuditStoreName) today = Date strDatabaseName = strDatabaseName & "-" & Year(today) & "-" & Month(today) &_ & "-" & Day(today) SET objAuditStoreDatabase = objAuditStore.GetDatabase(strDatabaseName) ' Create a new Audit Store database and attach to the Audit Store SET objAuditStoreDatabase = objAuditStore.AddDatabase(strDatabaseName, strServerName, strDatabaseName)