> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Windows Share V1

> The Windows Share connector can access content in a Windows Share or Server Message Block (SMB)/Common Internet File System (CIFS) filesystem.

export const schema = {
  "category": "Other",
  "categoryPriority": 1,
  "description": "Connector for Windows Shares (either CIFS or SMB) file systems. The Windows Share connector has been deprecated and may be removed in a future release. This connector will be superseded by the SMB2/3 connector.",
  "properties": {
    "category": {
      "default": "Filesystem",
      "hints": ["hidden", "readonly"],
      "title": "Category",
      "type": "string"
    },
    "connector": {
      "description": "Connector Type.",
      "hints": ["hidden"],
      "minLength": 1,
      "title": "Connector Type",
      "type": "string"
    },
    "description": {
      "description": "Optional description for this datasource.",
      "title": "Description",
      "type": "string"
    },
    "id": {
      "description": "Unique name for this datasource.",
      "minLength": 1,
      "pattern": "^[a-zA-Z0-9_-]+$",
      "title": "Datasource ID",
      "type": "string"
    },
    "parserId": {
      "description": "Parser used when parsing raw content. Retry parsing setting is available under crawl performance (advance setting)",
      "title": "Parser",
      "type": "string"
    },
    "pipeline": {
      "description": "Name of an existing index pipeline for processing documents.",
      "minLength": 1,
      "title": "Pipeline ID",
      "type": "string"
    },
    "properties": {
      "description": "Datasource configuration properties",
      "properties": {
        "add_failed_docs": {
          "default": false,
          "description": "Set to true to add documents even if they partially fail processing. Failed documents will be added with as much metadata as available, but may not include all expected fields.",
          "hints": ["advanced"],
          "title": "Add failed documents",
          "type": "boolean"
        },
        "bounds": {
          "default": "tree",
          "description": "Limits the crawl to a specific directory sub-tree, hostname or domain.",
          "enum": ["tree", "host", "domain", "none"],
          "title": "Crawl bounds",
          "type": "string"
        },
        "collection": {
          "description": "Collection documents will be indexed to.",
          "hints": ["hidden"],
          "pattern": "^[a-zA-Z0-9_-]+$",
          "title": "Collection",
          "type": "string"
        },
        "commit_on_finish": {
          "default": true,
          "description": "Set to true for a request to be sent to Solr after the last batch has been fetched to commit the documents to the index.",
          "hints": ["advanced"],
          "title": "Solr commit on finish",
          "type": "boolean"
        },
        "crawl_depth": {
          "default": -1,
          "description": "Number of levels in a directory or site tree to descend for documents.",
          "exclusiveMinimum": false,
          "minimum": -1,
          "title": "Max crawl depth",
          "type": "integer"
        },
        "crawl_item_timeout": {
          "default": 600000,
          "description": "Time in milliseconds to fetch any individual document.",
          "exclusiveMinimum": true,
          "hints": ["advanced"],
          "minimum": 0,
          "title": "Fetch timeout",
          "type": "integer"
        },
        "db": {
          "description": "Type and properties for a ConnectorDB implementation to use with this datasource.",
          "hints": ["hidden"],
          "properties": {
            "aliases": {
              "default": false,
              "description": "Keep track of original URI-s that resolved to the current URI. This negatively impacts performance and size of DB.",
              "title": "Process Aliases?",
              "type": "boolean"
            },
            "inlinks": {
              "default": false,
              "description": "Keep track of incoming links. This negatively impacts performance and size of DB.",
              "title": "Process Inlinks?",
              "type": "boolean"
            },
            "inv_aliases": {
              "default": false,
              "description": "Keep track of target URI-s that the current URI resolves to. This negatively impacts performance and size of DB.",
              "title": "Process Inverted Aliases?",
              "type": "boolean"
            },
            "type": {
              "default": "com.lucidworks.connectors.db.impl.MapDbConnectorDb",
              "description": "Fully qualified class name of ConnectorDb implementation.",
              "minLength": 1,
              "title": "Implementation Class Name",
              "type": "string"
            }
          },
          "required": ["type"],
          "title": "Connector DB",
          "type": "object"
        },
        "enable_security_trimming": {
          "description": "Set to true to fetch and index access control information from files.",
          "hints": ["advanced"],
          "properties": {
            "ad_cache_groups": {
              "default": false,
              "description": "Set to true to enable caching of the Active Directory group hierarchy to speed up security trimming processes.",
              "title": "Cache AD groups",
              "type": "boolean"
            },
            "ad_connect_timeout": {
              "default": 3000,
              "description": "Time in milliseconds for connecting to Active Directory. Default is 3000 ms.",
              "exclusiveMinimum": false,
              "minimum": 0,
              "title": "AD connect timeout",
              "type": "integer"
            },
            "ad_context_factory": {
              "default": "com.sun.jndi.ldap.LdapCtxFactory",
              "description": "The classname of the context factory to use to create the initial context.",
              "title": "AD context factory",
              "type": "string"
            },
            "ad_credentials": {
              "description": "A password for the User Principal.",
              "hints": ["secret"],
              "title": "AD credentials",
              "type": "string"
            },
            "ad_group_base_dn": {
              "description": "Active Directory node or directory where group objects reside.",
              "title": "AD group base DN",
              "type": "string"
            },
            "ad_group_filter": {
              "description": "Valid LDAP filter to find group objects in Active Directory, such as '(&(objectclass=group))'.",
              "title": "AD group filter",
              "type": "string"
            },
            "ad_read_timeout": {
              "default": 5000,
              "description": "Time in milliseconds for reading responses from Active Directory. Default is 5000 ms.",
              "exclusiveMinimum": false,
              "minimum": 0,
              "title": "AD read timeout",
              "type": "integer"
            },
            "ad_read_token_groups": {
              "default": true,
              "description": "Set to true to read groups using TOKEN_GROUPS. Only applied if 'Cache AD groups' is disabled.",
              "title": "Read AD token groups",
              "type": "boolean"
            },
            "ad_referral": {
              "default": "follow",
              "description": "The method for processing referrals encountered by the service provider.",
              "title": "AD referral",
              "type": "string"
            },
            "ad_security_authentication": {
              "default": "simple",
              "description": "The type of security authentication to use.",
              "title": "AD security authentication",
              "type": "string"
            },
            "ad_url": {
              "description": "Fully qualified URL of the LDAP or AD server where user information is stored, in the format: 'ldap:://hostname:389' or 'ldap://hostname:636'.",
              "pattern": "ldaps?://.+",
              "title": "Active Directory URL",
              "type": "string"
            },
            "ad_user_base_dn": {
              "description": "Active Directory node or directory where user objects reside.",
              "title": "AD user base DN",
              "type": "string"
            },
            "ad_user_filter": {
              "description": "Valid LDAP filter to find user objects in Active Directory, such as '(&(objectclass=user)(sAMAccountName={0}))'.",
              "title": "AD user filter",
              "type": "string"
            },
            "ad_user_principal_name": {
              "description": "A User Principal with permissions to access the Active Directory server in the format user@domain. ",
              "pattern": ".+@.+",
              "title": "AD User Principal",
              "type": "string"
            },
            "cache_element_expiration_time": {
              "default": 7200,
              "description": "Time in seconds to store items in the caches. The default is 7200 seconds (2 hours).",
              "exclusiveMinimum": false,
              "minimum": 0,
              "title": "SIDS cache expiration time",
              "type": "integer"
            },
            "enable_SIDs_cache": {
              "default": true,
              "description": "Set to true to cache user SIDs to reduce the number of Active Directory requests.",
              "title": "Cache user SIDs",
              "type": "boolean"
            },
            "max_cache_size": {
              "default": 1000,
              "description": "Maximum number of items to store in the SIDS cache before refreshing. The default is 100 items.",
              "exclusiveMinimum": false,
              "minimum": 0,
              "title": "Maximum SIDS cache size",
              "type": "integer"
            }
          },
          "title": "Enable security trimming",
          "type": "object"
        },
        "exclude_paths": {
          "description": "Regular expressions for URI patterns to exclude. This will limit this datasource to only URIs that do not match the regular expression.",
          "items": {
            "type": "string"
          },
          "title": "Exclusive regexes",
          "type": "array"
        },
        "include_extensions": {
          "description": "List the file extensions to be fetched. Note: Files with possible matching MIME types but non-matching file extensions will be skipped. Extensions should be listed without periods, using whitespace to separate items (e.g., 'pdf zip').",
          "items": {
            "type": "string"
          },
          "title": "Included file extensions",
          "type": "array"
        },
        "include_paths": {
          "description": "Regular expressions for URI patterns to include. This will limit this datasource to only URIs that match the regular expression.",
          "items": {
            "type": "string"
          },
          "title": "Inclusive regexes",
          "type": "array"
        },
        "index_directories": {
          "default": false,
          "description": "Set to true to add directories to the index as documents. If set to false, directories will not be added to the index, but they will still be traversed for documents.",
          "title": "Index directories",
          "type": "boolean"
        },
        "initial_mapping": {
          "category": "Field Transformation",
          "categoryPriority": 6,
          "description": "Provides mapping of fields before documents are sent to an index pipeline.",
          "hints": ["advanced"],
          "properties": {
            "condition": {
              "description": "Define a conditional script that must result in true or false. This can be used to determine if the stage should process or not.",
              "hints": ["code", "code/javascript", "advanced"],
              "title": "Condition",
              "type": "string"
            },
            "label": {
              "description": "A unique label for this stage.",
              "hints": ["advanced"],
              "maxLength": 255,
              "title": "Label",
              "type": "string"
            },
            "mappings": {
              "default": [{
                "operation": "move",
                "source": "fetch_time",
                "target": "fetch_time_dt"
              }, {
                "operation": "move",
                "source": "ds:description",
                "target": "description"
              }],
              "description": "List of mapping rules",
              "hints": ["advanced"],
              "items": {
                "properties": {
                  "operation": {
                    "default": "copy",
                    "description": "The type of mapping to perform: move, copy, delete, add, set, or keep.",
                    "enum": ["copy", "move", "delete", "set", "add", "keep"],
                    "hints": ["advanced"],
                    "title": "Operation",
                    "type": "string"
                  },
                  "source": {
                    "description": "The name of the field to be mapped.",
                    "hints": ["advanced"],
                    "title": "Source Field",
                    "type": "string"
                  },
                  "target": {
                    "description": "The name of the field to be mapped to.",
                    "hints": ["advanced"],
                    "title": "Target Field",
                    "type": "string"
                  }
                },
                "required": ["source"],
                "type": "object"
              },
              "title": "Field Mappings",
              "type": "array"
            },
            "reservedFieldsMappingAllowed": {
              "default": false,
              "hints": ["advanced"],
              "title": "Allow System Fields Mapping?",
              "type": "boolean"
            },
            "skip": {
              "default": false,
              "description": "Set to true to skip this stage.",
              "hints": ["advanced"],
              "title": "Skip This Stage",
              "type": "boolean"
            },
            "unmapped": {
              "description": "If fields do not match any of the field mapping rules, these rules will apply.",
              "hints": ["advanced"],
              "properties": {
                "operation": {
                  "default": "copy",
                  "description": "The type of mapping to perform: move, copy, delete, add, set, or keep.",
                  "enum": ["copy", "move", "delete", "set", "add", "keep"],
                  "hints": ["advanced"],
                  "title": "Operation",
                  "type": "string"
                },
                "source": {
                  "description": "The name of the field to be mapped.",
                  "hints": ["advanced"],
                  "title": "Source Field",
                  "type": "string"
                },
                "target": {
                  "description": "The name of the field to be mapped to.",
                  "hints": ["advanced"],
                  "title": "Target Field",
                  "type": "string"
                }
              },
              "required": ["source"],
              "title": "Unmapped Fields",
              "type": "object"
            }
          },
          "title": "Initial field mapping",
          "type": "object",
          "unsafe": false
        },
        "kerberos_keytab": {
          "description": "Full path to the Kerberos keytab file.",
          "hints": ["advanced"],
          "title": "Kerberos keytab",
          "type": "string"
        },
        "kerberos_user": {
          "description": "Kerberos principal name, i.e., 'username@YOUR-REALM.COM'.",
          "hints": ["advanced"],
          "title": "Kerberos principal",
          "type": "string"
        },
        "max_bytes": {
          "default": 10485760,
          "description": "Maximum size (in bytes) of documents to fetch or -1 for unlimited file size.",
          "exclusiveMinimum": false,
          "minimum": -1,
          "title": "Maximum file size (bytes)",
          "type": "integer"
        },
        "max_docs": {
          "default": -1,
          "description": "Maximum number of documents to fetch. The default (-1) means no limit.",
          "exclusiveMinimum": false,
          "minimum": -1,
          "title": "Max items",
          "type": "integer"
        },
        "max_threads": {
          "default": 1,
          "description": "The maximum number of threads to use for fetching data. Note: Each thread will create a new connection to the repository, which may make overall throughput faster, but this also requires more system resources, including CPU and memory.",
          "hints": ["advanced"],
          "title": "Fetch threads",
          "type": "integer"
        },
        "maximum_connections": {
          "default": 10000,
          "description": "Maximum number of concurrent connections to the filesystem. A large number of documents could cause a large number of simultaneous connections to the repository and lead to errors or degraded performance. In some cases, reducing this number may help performance issues.",
          "hints": ["advanced"],
          "title": "Maximum fetch connections",
          "type": "integer"
        },
        "password": {
          "description": "Password for the user. Do not set a password if Kerberos authentication is used.",
          "hints": ["secret"],
          "title": "Password",
          "type": "string"
        },
        "url": {
          "description": "The Windows share host followed by the window’s share name, e.g., smb://172.17.0.3:32778/share/Base_files-7f79d267-98b2-4175-b3ba-9274b21ce3a3/",
          "minLength": 1,
          "pattern": ".*:.*",
          "title": "Start link",
          "type": "string"
        },
        "username": {
          "description": "A user in the Windows domain with READ permissions for the Windows Share. Do not set username if Kerberos authentication is used.",
          "title": "Username",
          "type": "string"
        },
        "verify_access": {
          "default": true,
          "description": "Set to true to require successful connection to the filesystem before saving this datasource.",
          "hints": ["advanced"],
          "title": "Validate access",
          "type": "boolean"
        },
        "windows_domain": {
          "description": "Authentication domain for the user. Not required if using Kerberos authentication.",
          "title": "Windows Domain",
          "type": "string"
        },
        "with_kerberos": {
          "default": false,
          "description": "Select to use Kerberos for authentication instead of username and password. Kerberos authentication requires information for the advanced properties 'Kerberos principal' and 'Kerberos keytab'. If 'false', Username and Password must be entered.",
          "hints": ["advanced"],
          "title": "Use Kerberos Authentication",
          "type": "boolean"
        }
      },
      "propertyGroups": [{
        "label": "Security Trimming",
        "properties": ["enable_security_trimming"]
      }, {
        "label": "Limit Documents",
        "properties": ["max_docs", "max_bytes", "index_directories", "crawl_depth", "bounds", "include_paths", "exclude_paths", "include_extensions"]
      }, {
        "label": "Crawl Performance",
        "properties": ["max_threads", "add_failed_docs", "crawl_item_timeout", "maximum_connections"]
      }, {
        "label": "Field Mapping",
        "properties": ["initial_mapping"]
      }],
      "required": ["url"],
      "title": "Properties",
      "type": "object"
    },
    "type": {
      "description": "Datasource type supported by the selected connector type.",
      "hints": ["hidden"],
      "minLength": 1,
      "title": "Datasource Type",
      "type": "string"
    },
    "type_description": {
      "default": "Connector for Windows Shares (either CIFS or SMB) file systems. The Windows Share connector has been deprecated and may be removed in a future release. This connector will be superseded by the SMB2/3 connector.",
      "hints": ["hidden", "readonly"],
      "title": "Type Description",
      "type": "string"
    }
  },
  "required": ["id", "connector", "type", "pipeline", "properties"],
  "title": "Windows Share (deprecated)",
  "type": "object",
  "unsafe": false
};

export const SchemaParamFields = ({schema}) => {
  const sanitize = str => {
    if (typeof str !== "string") return str;
    return str.replace(/^"(.*)"$/s, "$1").replace(/\\/g, "").replace(/"/g, "'");
  };
  const formatDescription = str => {
    const s = sanitize(str);
    return (/[.!?]\)*$/).test(s) ? s : `${s}.`;
  };
  const {description, properties = {}, required: requiredProps = []} = schema;
  const visibleProps = useMemo(() => Object.entries(properties).filter(([, prop]) => !prop.hints?.includes("hidden")), [properties]);
  return <div>
      {description && <p>{formatDescription(description)}</p>}

      {visibleProps.map(([name, prop]) => {
    const isRequired = requiredProps.includes(name);
    const hasDefault = prop.default !== undefined;
    const rawDefault = prop.default;
    const isComplexDefault = hasDefault && (typeof rawDefault === "object" || typeof rawDefault === "string" && (rawDefault.length > 20 || rawDefault.includes('"')));
    const fieldProps = {
      key: name,
      body: prop.title || name,
      type: prop.type,
      ...prop.title && ({
        post: [<><span className="text-stone-400 dark:text-stone-500">API property: </span>{name}</>]
      }),
      ...isRequired && ({
        required: true
      }),
      ...!isComplexDefault && hasDefault ? {
        default: sanitize(String(rawDefault))
      } : {}
    };
    const isObject = prop.type === "object" && prop.properties;
    const isArrayOfObjects = prop.type === "array" && prop.items?.type === "object" && prop.items.properties;
    return <ParamField {...fieldProps}>
            {prop.description && <p>{formatDescription(prop.description)}</p>}

            {isComplexDefault && <div className="flex">
                <p>
                  <strong>Default:</strong>
                </p>
                <pre className="!my-0">
                  <code>
                    {JSON.stringify(rawDefault, null, 2)}
                  </code>
                </pre>
              </div>}

            {isArrayOfObjects && <div className="flex">
              <p>
                <strong>Object attributes:</strong>
              </p>
              <pre className="!my-0">
                <code>
                  {'{\n'}
                  {Object.entries(prop.items.properties).map(([iname, iprop]) => <>
                      {`  ${iname}`}
                      {prop.items?.required?.includes(iname) && <span style={{
      color: 'red'
    }}> required</span>}
                      {`: {\n    display name: ${sanitize(iprop.title || '')}\n    type: ${iprop.type}\n  }\n`}
                    </>)}
                  {'}'}
                </code>
              </pre>
              </div>}

            {isObject && <Expandable title="properties">
                <SchemaParamFields schema={{
      properties: prop.properties,
      required: prop.required
    }} />
              </Expandable>}
          </ParamField>;
  })}
    </div>;
};

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/fusion-connectors/connectors/v1/windows-share

[mintlify link]: https://doc.lucidworks.com/docs/fusion-connectors/connectors/v1/windows-share

[old doc.lw link]: https://doc.lucidworks.com/fusion-connectors/38

<Callout icon="plug" color="#A4C6F7" iconType="solid">
  **Compatible with Fusion version:** 4.0.0 through 4.2.6
</Callout>

<Note>
  Deprecation and removal notice

  This connector is deprecated as of Fusion 4.0 and is removed or expected to be removed as of Fusion 5.0. Use the Windows Share SMB2/3 V1 or Windows Share SMB2/3 V2 connector instead.

  For more information about deprecations and removals, including possible alternatives, see [Deprecations and Removals](/docs/fusion-connectors/deprecations-and-removals).
</Note>

The Windows Share connector can access content in a Windows Share or Server Message Block (SMB)/Common Internet File System (CIFS) filesystem.

See this tutorial about configuring a Windows Share datasource and enabling security trimming:

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/k7I76h3aWlE" title="Descriptive video title" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

<LwTemplate />

## Access Control Lists (ACLs)

The connector is able to retrieve and store ACL details when crawling with the 'smb' type. There are several properties available to define how the datasource should read the user and group information found in Active Directory, and when security trimming is enabled, document results will take user authorizations into consideration.

For each document, the `acl` field is populated with data that can be used at search time to filter the results so that only people that have been granted access at the user level or through group membership can see them. Two kinds of tokens are stored: Allow and Deny. The format used is as follows:

Allow:`WINA<SID>`

Deny:`WIND<SID>`

Where `SID` is the security identifier commonly used in Microsoft Windows systems. There are some well known SIDs that can be used in the `acl` field to make documents that are crawled through some other mechanism than by using SMB data source behave, from the `acl pow`, the same way as the crawled SMB content:

| SID              | Description                                                                                                                                                                                                  |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| S-1-1-0          | Everyone.                                                                                                                                                                                                    |
| S-1-5-domain-500 | A user account for the system administrator. By default, it is the only user account that is given full control over the system.                                                                             |
| S-1-5-domain-512 | Domain Admins: a global group whose members are authorized to administer the domain. By default, the Domain Admins group is a member of the Administrators group on all computers that have joined a domain. |
| S-1-5-domain-513 | Domain Users.                                                                                                                                                                                                |

Note that some of the listed SIDs contain a `domain` token. This means that the actual SIDs differ from system to system. To find out the SIDs for particular user in particular system you can use the information provided by the Windows command line tool `whoami` by executing command `whoami /all`.

You can populate the `acl` field in your documents with these Windows SIDs to make them searchable in Fusion. For example, if you wanted to make some documents available to "Everyone" you would populate the `acl` field with the `WINAS-1-1-0` token. If you wanted to make all docs from one data source available to everybody you can use the literal definitions in the data source configuration.

## Configuration

<Tip>
  When entering configuration values in the UI, use *unescaped* characters, such as `\t` for the tab character. When entering configuration values in the API, use *escaped* characters, such as `\\t` for the tab character.
</Tip>

<SchemaParamFields schema={schema} />
