Hello Everyone! I am trying to enable File and Printer Sharing via a fixlet. I have created the action in numerous ways such as dos, cmd /c, waithidden, using batch file, etc. All complete successfully but File and Printer sharing isn’t enabled. If I run the same commands local on the PC or via a batch file, it works fine. I tried using the RunAs option in the latest action to see if it was an issue with the SYSTEM account. Still no success. Has anyone tried enabling File and Printer Sharing and been successful? I would have to think this is a common task. Below is the latest action. Any help is appreciated.
action parameter query "username" with description "Please specify the name of a user in the form of DOMAIN\USER for domain accounts"
delete __appendfile
delete runquiet.bat
appendfile @ECHO OFF
appendfile SET PROFILES=Domain
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Session-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Session-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Name-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Name-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Datagram-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Datagram-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC-EPMAP)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv4-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv4-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv6-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv6-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (LLMNR-UDP-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="File and Printer Sharing (LLMNR-UDP-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (UPnP-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (UPnP-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (NB-Name-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (NB-Name-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (NB-Datagram-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (NB-Datagram-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (WSD EventsSecure-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (WSD EventsSecure-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (WSD Events-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (WSD Events-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (SSDP-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (SSDP-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (UPnPHost-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (WSD-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (WSD-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (LLMNR-UDP-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (LLMNR-UDP-Out)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (Pub-WSD-In)" new enable=yes profile=%PROFILES%
appendfile netsh advfirewall firewall set rule name="Network Discovery (Pub WSD-Out)" new enable=yes profile=%PROFILES%
move __appendfile runquiet.bat
override run
hidden=true
RunAs=localuser
AsAdmin=true
user={parameter "username" of action}
password=required
completion=job
run cmd /C runquiet.bat
delete runquiet.bat