Monday, June 2, 2008
Access Manager LDAP -- add new user
Authenticator2.Application _AuthApp = new Authenticator2.Application(); Authenticator2.Document _AuthDoc; Authenticator2.DSConfigurations objDSConfigs; Authenticator2.Configuration objConfig; objDSConfigs = ((Authenticator2.DSConfigurations)_AuthApp.DSConfigurations); objConfig = ((Authenticator2.Configuration)objDSConfigs.Add("cognosserver",389,"dc=dev",0)); objConfig.DefaultSecuritySource = true; _AuthDoc = ((Authenticator2.Document)((Authenticator2.AuthenticatorDocuments)_AuthApp.Documents).OpenWithBasicSignon("default","administrator","mypassword","Root User Class")); Authenticator2.User objUser; objUser = ((Authenticator2.User)((Authenticator2.Users)((Authenticator2.Folder)_AuthDoc.UserFolder).Users).Add("MyNewUser")); //clean up System.Runtime.InteropServices.Marshal.ReleaseComObject(_AuthDoc); System.Runtime.InteropServices.Marshal.ReleaseComObject(_AuthApp);