Impersonation info via AMO - not copied when cloning SSAS DB ? RRS feed

  • Question

  • Hi there,

    I have SSAS DB which has Impersonation info set to specific Windows user name and password.

    I have AMO script in SSIS, which clone DB to another with different name, update structure with full expand and when I try to process new DB it fails with error "The name provided is not a properly formed account name....."

    When i check it in SSMS I see, that impersonation mode is set to correct user but without password. When I set password manually in SSMS, then I am able to process new DB from AMO script.

    Could you please let me know how to set with AMO also impersonation mode to USER and PASSWORD ?

    Here is my code

    Public Sub Main() Dim Connection As ConnectionManager Dim Server As New Server Connection = Dts.Connections("SSAS") Server.Connect(Connection.ConnectionString)

    'Clone existing DB CUBE

    Dim OldDB As Database = Server.Databases.FindByName("CUBE") Dim NewDB As Database = OldDB.Clone() NewDB.Name = "CUBE_merging" NewDB.ID = "CUBE_merging" Server.Databases.Add(NewDB) NewDB.Update(UpdateOptions.ExpandFull)

    NewDB.Process(ProcessType.ProcessFull) '!!!!!!!! processing not working Server.Disconnect() Dts.TaskResult = ScriptResults.Success End Sub

    Could someone help? Thanks

    • Edited by volyn Friday, January 11, 2013 4:34 PM Grammatics
    Friday, January 11, 2013 4:31 PM


All replies

  • Hi volyn,

    Thank you for your question. 

    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 


    Elvis Long
    TechNet Community Support

    Thursday, January 17, 2013 8:14 AM
  • Hello

    It is by design that the password cannot be copied and has to be entered manually. It is similar with the Deployment Wizard too.
    What you could do is to use AMO and add the information after the new database was created.
    Check out the AMO reference here:
         ImpersonationInfo Class
                ImpersonationInfo Constructor (ImpersonationMode)
                ImpersonationInfo Constructor (String, String)
                ImpersonationInfo Constructor (ImpersonationMode, String, String)
         ImpersonationMode Enumeration

    From the Adventure Works sample AMO code you can see how it is done for the Service Account:
                    = new ImpersonationInfo(ImpersonationMode.ImpersonateServiceAccount);

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Microsoft Online Community Support

    Friday, January 18, 2013 9:53 PM