Beispiel #1
0
 protected override void Execute(CodeActivityContext context)
 {
     using (var principalContext = new PrincipalContext(ContextType.Domain))
     {
         using (SecureStringToStringMarshaler sm = new SecureStringToStringMarshaler(Password.Get(context)))
         {
             bool          authenticated = principalContext.ValidateCredentials(Username.Get(context), sm.String);
             UserPrincipal principal     = UserPrincipal.FindByIdentity(principalContext, Username.Get(context));
             Authenticated.Set(context, authenticated);
             Email.Set(context, principal.EmailAddress);
             GivenName.Set(context, principal.GivenName);
         }
     }
 }