Esempio n. 1
0
        public SPManagedAccountInstance(ObjectInstance prototype, SPManagedAccount managedAccount)
            : this(prototype)
        {
            if (managedAccount == null)
            {
                throw new ArgumentNullException("managedAccount");
            }

            m_managedAccount = managedAccount;
        }
        public BaristaSearchService(SPFarm spFarm, SPManagedAccount managedAccount)
            : base(NtServiceName, spFarm)
        {
            if (managedAccount == null)
            {
                throw new ArgumentNullException("managedAccount");
            }

            ProcessIdentity.ProcessAccount = SPProcessAccount.LookupManagedAccount(managedAccount.Sid);
            ProcessIdentity.ManagedAccount = managedAccount;
            ProcessIdentity.IsCredentialDeploymentEnabled = true;
            ProcessIdentity.IsCredentialUpdateEnabled     = true;
        }
Esempio n. 3
0
        protected SPManagedAccount GetManagedAccount(SPFarm farm, ManagedAccountDefinition managedAccountDefinition)
        {
            var loginName = managedAccountDefinition.LoginName;
            var accounts  = new SPFarmManagedAccountCollection(farm);

            SPManagedAccount currentAccount = null;

            try
            {
                currentAccount = accounts[loginName];
            }
            catch (Exception)
            { }

            return(currentAccount);
        }
Esempio n. 4
0
 private static SecureStoreServiceClaim CreateServiceClaim(SPManagedAccount account)
 {
     return(new SecureStoreServiceClaim(SPClaimTypes.UserLogonName, "Windows", account.Username));
 }