I have been searching for a way to turn on network discovery for all profiles during provisioning but I have yet to find a way, information I can find is either old or has spotty results. I have tried various methods in unattend.xml they are not working, and usually making things worse by keeping the agent from running after CTOS. Does anyone know if there is a way to turn on file and print sharing during provisioning so that the OSD doesn't pop up asking for network visibility? We have found that if someone isn't there to answer that, then file and print sharing remains off and provisioning fails.
Could you be a little more specific?
I sounds like you are having trouble with the "network location" setting in Windows- where you tell the OS the network that is connected is work, public or home.
If this is the case, it's pretty easy to set in the unattend.xml using Windows System Image manager from the Windows ADK.
For windows 10, you should set this in the specialize pass with the unattend.xml having text as below:
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
It's not network locations per se, but the network discovery setting under sharing options, the radio button marked "Turn on Network Discovery". I've found a PowerShell command to turn that on in my image, but it does not carry over to the coreload. I've tried running it from a provisioning task, but usually if network discovery is off, then provisioning does not even complete. This was (is) not a problem in Windows 7, but is happening very frequently in Windows 10.
I have tested on multiple systems and found that I can reliably enable this whether I answer the OSD or not by opening up the network and file sharing rules in the firewall before taking my image. My goal was to make it foolproof since we don't sit around watching the provisioning process so that the OSD can be answered. I couldn't get rid of it, but this is the next best thing.