예제 #1
0
 // Token: 0x0600160E RID: 5646 RVA: 0x000529B0 File Offset: 0x00050BB0
 public static void ThrowExceptionIfProxyIsNeeded(TaskContext context, string remoteServerFqdn, int remoteServerVersion, bool shouldAsyncProxy, LocalizedString confirmationMessage, CmdletProxyInfo.ChangeCmdletProxyParametersDelegate changeCmdletProxyParameters)
 {
     if (CmdletProxy.ShouldProxyCmdlet(context, remoteServerFqdn, remoteServerVersion))
     {
         throw new CmdletNeedsProxyException(new CmdletProxyInfo(remoteServerFqdn, remoteServerVersion, shouldAsyncProxy, confirmationMessage, changeCmdletProxyParameters));
     }
 }
예제 #2
0
 // Token: 0x06001610 RID: 5648 RVA: 0x00052A0B File Offset: 0x00050C0B
 public static bool TryToProxyOutputObject(ICmdletProxyable cmdletProxyableObject, TaskContext context, string remoteServerFqdn, int remoteServerVersion, bool shouldAsyncProxy, LocalizedString confirmationMessage, CmdletProxyInfo.ChangeCmdletProxyParametersDelegate changeCmdletProxyParameters)
 {
     if (CmdletProxy.ShouldProxyCmdlet(context, remoteServerFqdn, remoteServerVersion))
     {
         cmdletProxyableObject.SetProxyInfo(new CmdletProxyInfo(remoteServerFqdn, remoteServerVersion, shouldAsyncProxy, confirmationMessage, changeCmdletProxyParameters));
         return(true);
     }
     return(false);
 }
예제 #3
0
        // Token: 0x0600160F RID: 5647 RVA: 0x000529D0 File Offset: 0x00050BD0
        public static bool TryToProxyOutputObject(ICmdletProxyable cmdletProxyableObject, TaskContext context, ADUser user, bool shouldAsyncProxy, LocalizedString confirmationMessage, CmdletProxyInfo.ChangeCmdletProxyParametersDelegate changeCmdletProxyParameters)
        {
            if (user == null)
            {
                return(false);
            }
            int    remoteServerVersion;
            string remoteServerForADUser = TaskHelper.GetRemoteServerForADUser(user, new Task.TaskVerboseLoggingDelegate(context.CommandShell.WriteVerbose), out remoteServerVersion);

            return(CmdletProxy.TryToProxyOutputObject(cmdletProxyableObject, context, remoteServerForADUser, remoteServerVersion, shouldAsyncProxy, confirmationMessage, changeCmdletProxyParameters));
        }
예제 #4
0
        // Token: 0x0600160D RID: 5645 RVA: 0x00052978 File Offset: 0x00050B78
        public static void ThrowExceptionIfProxyIsNeeded(TaskContext context, ADUser user, bool shouldAsyncProxy, LocalizedString confirmationMessage, CmdletProxyInfo.ChangeCmdletProxyParametersDelegate changeCmdletProxyParameters)
        {
            if (user == null)
            {
                return;
            }
            int    remoteServerVersion;
            string remoteServerForADUser = TaskHelper.GetRemoteServerForADUser(user, new Task.TaskVerboseLoggingDelegate(context.CommandShell.WriteVerbose), out remoteServerVersion);

            CmdletProxy.ThrowExceptionIfProxyIsNeeded(context, remoteServerForADUser, remoteServerVersion, shouldAsyncProxy, confirmationMessage, changeCmdletProxyParameters);
        }
예제 #5
0
        // Token: 0x06001613 RID: 5651 RVA: 0x00052AE4 File Offset: 0x00050CE4
        private static bool ShouldProxyCmdlet(TaskContext context, string remoteServerFqdn, int remoteServerVersion)
        {
            if (string.IsNullOrWhiteSpace(remoteServerFqdn))
            {
                return(false);
            }
            if (context.ExchangeRunspaceConfig == null)
            {
                return(false);
            }
            if (ExTraceGlobals.FaultInjectionTracer.IsTraceEnabled(TraceType.FaultInjection))
            {
                bool flag = false;
                ProxyHelper.FaultInjection_ShouldForcedlyProxyCmdlet(context.ExchangeRunspaceConfig.ConfigurationSettings.OriginalConnectionUri, remoteServerFqdn, ref flag);
                if (flag)
                {
                    return(true);
                }
            }
            string localServerFqdn = TaskHelper.GetLocalServerFqdn(null);

            if (string.IsNullOrEmpty(localServerFqdn))
            {
                CmdletLogger.SafeAppendGenericError(context.UniqueId, "ShouldProxyCmdlet", "GetLocalServerFqdn returns null/empty value", false);
                return(false);
            }
            if (string.Equals(remoteServerFqdn, localServerFqdn, StringComparison.OrdinalIgnoreCase))
            {
                return(false);
            }
            if (CmdletProxy.CanServerBeProxiedTo(remoteServerVersion))
            {
                return(true);
            }
            CmdletLogger.SafeAppendGenericInfo(context.UniqueId, "ShouldProxyCmdlet", string.Format("Remote server version {0} doesn't support be proxied.", ProxyHelper.GetFriendlyVersionInformation(remoteServerVersion)));
            return(false);
        }