internal static void CheckIfRunningOnService() { if (!ADSessionSettings.IsRunningOnCmdlet()) { throw new InvalidOperationException("This method should only be called from non-service code"); } }
private static void CheckIfRunningOnCmdlet() { if (ADSessionSettings.IsRunningOnCmdlet()) { throw new InvalidOperationException("This method should never be called from non-service code"); } }
internal static ADObjectId ResolveDNIfNecessary(ADObjectId obj) { if (ADSessionSettings.IsRunningOnCmdlet() || ConfigBase <AdDriverConfigSchema> .GetConfig <bool>("IsSoftLinkResolutionEnabledForAllProcesses")) { return(ADObjectIdResolutionHelper.ResolveDN(obj)); } return(obj); }