How to create user accounts by using the Small Business Accounting SDK (915511)



The information in this article applies to:

  • Microsoft Office Small Business Accounting 2006
  • Microsoft Office Small Business Management Edition 2006
  • Microsoft Office Small Business Accounting 2006 Software Development Kit 1.2

INTRODUCTION

This article describes how to create Microsoft Office Small Business Accounting user accounts by using the IRoleInformation interface from the Small Business Accounting Software Development Kit (SDK).

MORE INFORMATION

To create a user account by using the IRoleInformation interface from the SDK, you must run a script that creates the user account, that grants the user account access to the database, and that assigns a Small Business Accounting role to the user account.

The following example contains sample code that performs these tasks. In the sample code, the TestUser user account is added. This user account resides on a computer that is named WORKSTATION1. The second parameter of the AssignUserRole method is an enumeration in the Microsoft.BusinessSolutions.SmallBusinessAccounting.Role type. This parameter represents the role that is assigned to the new user account. In the sample code, the SalesPerson role is assigned to the TestUser user account.
ISmallBusinessInstance iSbi = // Initialize SBA instance

IRoleInformation ri = iSbi.CreateRoleInformation();
ri.GrantUserDatabaseAccess(@"WORKSTATION1\TestUser");
ri.AssignUserRole(@"WORKSTATION1\TestUser", Role.SalesPerson);


Modification Type:MinorLast Reviewed:3/30/2006
Keywords:kbMBSMigrate kbhowto KB915511 kbAudEndUser kbAudKnowledgeWorker