IsSystemAccount property

Gets a value indicating whether the account is a Windows system account.

Syntax

bool IsSystemAccount{get;}

Return value

Returns true if the account is a Windows system account; otherwise, false.

Discussion of the IsSystemAccount property

When you attach a new database to the audit store, you must set the database to allow access by the management database account. Before you call the AddAuditServerAccount method, you should check to see if the management database account is a Windows system account because if it is, the Account.UserName property is not a Windows domain account name and therefore cannot be passed directly to the AddAuditServerAccount method.

Example

The following code sample first checks to make sure the management database account is not a system account. If it is not a system account, the sample calls the AddAuditServerAccount method. If the management database is a system account, the sample returns an error message.

...

' Grant permission to management database to access the audit store database
SET objAuditServers = objInstallation.AuditServers
FOR EACH objAuditServer IN objAuditServers
    SET objAuditServerAccount = objAuditServer.OutgoingAccount
    IF NOT objAuditServerAccount.IsSystemAccount THEN
        objAuditStoreDatabase.AddAuditServerAccount objAuditServerAccount.UserName, & _
		objAuditServerAccount.IsWindowsAccount
        wscript.echo "Added management database account '" & objAuditServerAccount.UserName & "'."
    ELSE
        wscript.echo "Cannot add account for management database '" & objAuditServer.Name & _
	& "' because the account '" & objAuditServerAccount.UserName & _
	& "' is a system account."
        wscript.echo "NOTE: Please add allowed incoming management database for '" & _
	& objAuditServer.Name & _
	& "' to the new audit store database in Audit Manager."
    END IF

See also