BusinessObjects Board

Code to create users from excel

Hi All,

We have 1000s of users that need to be created. These are in excel - is there a way to automatically create them in BO and assign them to groups.

Does anyone have custom code that they can share - if there is no other option?

thanks,
hena


hena (BOB member since 2010-08-17)

Take a look at this sample:
http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/500c0af0-18ba-2b10-c293-fb67f3286046


Marfi :poland: (BOB member since 2006-12-18)

Easiest way is to use a text file import with the Import Wizard.


joepeters :us: (BOB member since 2002-08-29)

hey Joe , can you elaborate on your solution?


Marfi :poland: (BOB member since 2006-12-18)

You can create a text file that contains the user ID, full name, group name, and optionally a profile. Then use the import wizard to create user IDs for each entry. Look for “Text File Format” in the Import Wizard online help for more info.


joepeters :us: (BOB member since 2002-08-29)

Is there a limitation on the # of users that can be imported using excel file? Is it slow?
Does it assign users to groups as well?
Does it work well?


hena (BOB member since 2010-08-17)

I don’t think there’s a limit; not that we’ve hit, anyway. But it’s a flat text file, not Excel.

I wouldn’t say it’s noticeably slow, but I haven’t done any real timings.

Yes, it assigns users to groups.

It’s not as flexible as the text file import process in earlier versions, but it does work. You can’t use it to automatically set passwords, so you have to use the Account Manager in CMC to default everyone’s password to the same thing.


joepeters :us: (BOB member since 2002-08-29)

I came across this thread while trying to do the same thing - add users via Excel (VBA/SDK). Our challenge is to update a list of users from concurrent to named users due to a license change (for our developers). Using one of the spreadsheets on the download page here (the one to query events/schedules -very handy BTW) and a sample of some .Net code, I’ve accomplished that (I can post that code if anyone is interested). It works great if the user already exists. In our case, we have developers who might not have logged into a particular system yet so their account hasn’t been created yet.

We almost exclusively use Windows AD authentication (and groups) and almost never have enterprise aliases for accounts - so I would prefer to create accounts that way, but can live with creating them as enterprise aliases. The ImportWizard option does that, but… I’d prefer to have one interface. I dug up another .Net sample for creating users and have been trying to convert it to VBA but can’t quite get it to work… Any ideas? Could it be a missing reference?

  • the objInfoStore object (and the logon) are handled outside this sub
  • the comments here are from the .Net sample
  • references include the framework, infostore, plugin manager, user, user group, CMC, adn managed plugin libraries
  • the error is “the object doesn’t support this property or method” at this line :
    Set boUserPlugin = boPlugInMgr.GetPluginInfo(“CrystalEnterprise.User”)

Code :

Sub AddUserToBOE(sUserID As String)

Dim boPlugInMgr As PluginManager
Dim boUserPlugin As PluginInfo
Dim boNewUser As InfoObject
Dim boUserInfo As UserInfo
Dim boUser As User

Set boPlugInMgr = objInfoStore.PluginManager

    Set boUserPlugin = boPlugInMgr.GetPluginInfo("CrystalEnterprise.User")
    Set boNewUserObjects = objInfoStore.NewInfoObjectCollection()
    Set boNewUser = boNewUserObjects.Add(boUserPlugin)

    'set the name
    boNewUser.Title = "My Test User"

    'grab the plugin interface
    Set boUser = New User '(boNewUser.PluginInterface)

    'populate the user object with properties
    boUser.Connection = CeConnectionType.ceConnectionConcurrent
    boUser.FullName = "My Test User"
    boUser.NewPassword = "NewPassword"
    boUser.PasswordExpires = False
    boUser.AllowChangePassword = True

    'Save the changes to the Infostore
    objInfoStore.Commit (boNewUserObjects)

End Sub


sbroam (BOB member since 2006-08-24)