The “An error occured while trying to share . Incorrect function” problem.

Recently I was sharing out a log file directory on a Windows server. When I went to create the file, I received the following message:

“An error occurred while trying to share log$. Incorrect function.  The shared resource was not created at this time”.

ShareError

Great – why would this be?  You know who knew? Google. (To be fair, I did look in the Event Log and did not see any relevant entries – though I could have missed it… I didn’t look all that hard).

Anyway, so turns out this usually means there is some corruption in the firewall rules. That makes perfect sense because this server had had some host-based firewall management software installed at one point which died an unexplained death. That software was removed but apparently left scars on the system.

So, the fix is to reset the firewall config (true, there may be more elegant ways to do it, but this is certainly fast and seems reliable). So anyway, I went into the Firewall and Advanced Security section of windows and simply said “Restore Default Policy”.  (NB: If you’re connected via RDP – this will almost certainly break your connection, and it may require console access to restore your rules. If they are set by GPO then maybe a reboot but either way, you’ll probably be disconnected and may have a hard time reconnecting. Plan for that).

ShareFix

After being disconnected, connecting to the HyperV console and fixing the firewall configuration, I was able to create the share successfully.

Sam

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s