System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ServiceModel.Security.SecurityNegotiationException: Authentication failed on the remote side (the stream might still be available for additional authentication attempts).
---> System.Security.Authentication.AuthenticationException: Authentication failed on the remote side (the stream might still be available for additional authentication attempts).
---> System.ComponentModel.Win32Exception (0x80090311): Unknown error
--- End of inner exception stack trace ---
at System.Net.Security.NegoState.ThrowCredentialException(Int64 error)
at System.Net.Security.NegoState.ProcessReceivedBlob(Byte[] message, LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.ReadCallback(IAsyncResult transportResult)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)
at System.Net.Security.NegoState.EndProcessAuthentication(IAsyncResult result)
at System.Net.Security.NegotiateStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgradeAsync(Stream stream, OutWrapper`1 remoteSecurity)
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgradeAsync(Stream stream, OutWrapper`1 remoteSecurity)
at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgradeAsync(Stream stream)
at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgradeAsync(StreamUpgradeInitiator upgradeInitiator, OutWrapper`1 connectionWrapper, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeSpan timeout)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreambleAsync(IConnection connection, ArraySegment`1 preamble, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnectionAsync(TimeSpan timeout)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpenAsync(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.OnOpenAsyncInternal(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.System.ServiceModel.IAsyncCommunicationObject.OpenAsync(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.OpenAsyncInternal(TimeSpan timeout)
at System.Runtime.TaskHelpers.WaitForCompletion(Task task)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.Runtime.TaskHelpers.CallActionAsync[TArg](Action`1 action, TArg argument)
at System.ServiceModel.Channels.ServiceChannel.OnOpenAsync(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.OnOpenAsyncInternal(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.System.ServiceModel.IAsyncCommunicationObject.OpenAsync(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.OpenAsyncInternal(TimeSpan timeout)
at System.Runtime.TaskHelpers.WaitForCompletion(Task task)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(MethodCall methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(MethodInfo targetMethod, Object[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
脱域 or 网络问题
计算机脱域
- 计算机长时间没登陆域会自动脱离域,那么是不是超过30天未登录过域的计算机就一定会脱离域?
- 我的环境中发现有几台计算机由于休假或者出差长时间(两三个月)未登录域,这部分计算机在30天以前已经被我经用了,今天我启用这几台计算机之后,发现他们仍能后登陆域。计算机与域控间的网络正常。这个怎么解释?(域功能级别windows server 2008 r2)
回答:从您的描述中,我对这个问题的理解是您想知道计算机是不是超过30天未登录就一定会脱域。
默认情况下,加域计算机每三十天就会更改一次计算机密码,这个密码会分别被存在计算机本地和AD里面。同时,计算机本身会保存两份密码在本地:当前的密码和之前的密码。当计算机尝试和DC建立secure channel的时候,它会先使用最新的密码,如果这个密码无效,那么它会尝试使用之前的那个密码,如果这个密码也不能够和AD域里面保存的密码匹配,那么计算机和DC之间的secure channel就会被破坏,我们将不能通过域账号登录到这台电脑上。因为我们不清楚计算机密码是什么时候更改的,所以一般情况下,计算机不能登录到域的时间范围是31到60天。您看到的文章来自活动目录seo http://adirectory.blog.com/category/active-directory/
这里也要分两种情况:
- 加域的计算机shutdown的话,在它Start up之前,它是不会更改计算机密码的。
- 如果加域的计算机一直在运行,只是没有连到公司网络,那么它仍然会每隔三十天更改一次密码。
计算机脱域的时间不是随机的,它是由计算机能够联系到DC的时候最后一次改密码的时间决定的。举个例子:比如还有十天计算机就需要更改密码了,从这个时候开始,它将不再处于域环境中,那么,他不能够登录到域的时间是四十天之后。
具体一点说:比如它在域的最后一次密码是:password1(剩余有效期:10天),十天之后他需要改密码了,改为password2(有效期30天)。这时候在计算机保存的密码是:password1和password2,在DC端保存的密码是password1。在第三十五天的时候,如果计算机连到公司网络,它会首先尝试用password2去和DC建立安全通道,由于DC没有这个新的密码,计算机再次尝试并用password1,由于DC保存有这个密码,密码匹配,那么安全通道成功建立,计算机就可以登录到域。
然而,如果是在第四十五天的时候,这时候计算机已经第二次改密码了,假设为:password3。那么在计算机保存的密码是:password2和password3,在DC端保存的密码仍然是password1。当计算机连到公司网络,他会尝试用password3和password2去和DC建立安全通道,由于DC上面保存的密码是password1,他们不能够匹配,安全通道建立不起来,计算机就不能够登录到域环境。
不过由于我们无法得知计算是具体是什么时候更改的密码,所以在某种程度上面来讲,您可以认为计算机不能够登录到域的时间在31~60天的时间段内是随机的。
From:http://adirectory.blog.com/2015/02/computer-disconnects-from-domain/