FILE_ERROR_SHARE_CONNECT: an error happened while connecting to the remote share

Objective

Resolve error

Explanation

When you do a FILE_CHECK in a nessus auditfile for windows it will be checked via the default DRIVE$ share.  F$ in the example below

<check_type: "Windows" version:"2">
<group_policy: "MS Windows Server">
 
<custom_item>
 type : FILE_CHECK
 description: "Check if folder F:\Websites exist"
 value_type : POLICY_TEXT
 value_data : "F:\Websites"
 file_option: MUST_EXIST
</custom_item>
 
</group_policy>
</check_type>

If F$ is not accessible it will generate the error: FILE_ERROR_SHARE_CONNECT: an error happened while connecting to the remote share.

Solution

You could transform the FILE_CHECK into a AUDIT_POWERSHELL check

<check_type: "Windows" version:"2">
<group_policy: "MS Windows Server">
 
<custom_item>
 type: AUDIT_POWERSHELL
 description: "Check if folder F:\Websites exist"
 value_type: POLICY_TEXT
 value_data: "True"
 powershell_args: 'test-path F:\Websites' 
</custom_item>
 
</group_policy>
</check_type>