Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.40 KB | None | 0 0
  1. ::Reckon Accounts Installation - Firewall Exceptions & User Permissions (RA-INSTALLPREP.bat)
  2. ::Place Quickbooks Port Fixer.bat file in your datafile (QBW) location.
  3. @ECHO OFF
  4. SETLOCAL
  5. CLS
  6. ::Usergroup Default Setting (change if required)
  7. :: example(set DEFAULT_USERGROUP=Reckon_Users) will set folder permissions of the 'Reckon_Users' group to modify.
  8. set DEFAULT_USERGROUP=everyone
  9.  
  10. ::DONT NOT CHANGE
  11. set TITLE=Reckon Accounts Installation
  12. set DATAFOLDER=%~dp0
  13. IF %DATAFOLDER:~-1%==\ SET DATAFOLDER=%DATAFOLDER:~0,-1%
  14. GOTO Start
  15. :Start
  16. ECHO *** %TITLE% ***
  17. ECHO *** Firewall Exceptions and Folder Permissions ***
  18. ECHO.
  19. ECHO 1.Reckon Accounts 2013
  20. ECHO 2.Reckon Accounts 2014
  21. ECHO 3.Reckon Accounts 2015
  22. ECHO 4.Reckon Accounts 2016
  23. ECHO 5.Reckon Accounts 2017
  24. ECHO 6.Reckon Accounts 2018
  25. ECHO 7.Reckon Accounts 2019
  26. ECHO.
  27.  
  28. CHOICE /C 1234567 /M "Select a Version:"
  29.  
  30. IF ERRORLEVEL 7 GOTO 2019
  31. IF ERRORLEVEL 6 GOTO 2018
  32. IF ERRORLEVEL 5 GOTO 2017
  33. IF ERRORLEVEL 4 GOTO 2016
  34. IF ERRORLEVEL 3 GOTO 2015
  35. IF ERRORLEVEL 2 GOTO 2014
  36. IF ERRORLEVEL 1 GOTO 2013
  37.  
  38. :2013
  39. set YEAR=2013
  40. set PORT=10176
  41. set FOLDER=ReckonAccounts 2013
  42. set DATAUSER=QBDataServiceUser22
  43. goto CheckOS
  44.  
  45. :2014
  46. set YEAR=2014
  47. set PORT=10177
  48. set FOLDER=Reckon Accounts 2014
  49. set DATAUSER=QBDataServiceUser23
  50. goto CheckOS
  51.  
  52. :2015
  53. set YEAR=2015
  54. set PORT=10178
  55. set FOLDER=Reckon Accounts 2015
  56. set DATAUSER=QBDataServiceUser24
  57. goto CheckOS
  58.  
  59. :2016
  60. set YEAR=2016
  61. set PORT=55368-55372
  62. set PORT1=8019
  63. set PORT2=56726
  64. set FOLDER=Reckon Accounts 2016
  65. set DATAUSER=QBDataServiceUser25
  66. goto CheckOS
  67.  
  68. :2017
  69. set YEAR=2017
  70. set PORT=55373-55377
  71. set PORT1=8019
  72. set PORT2=56727
  73. set FOLDER=Reckon Accounts 2017
  74. set DATAUSER=QBDataServiceUser26
  75. goto CheckOS
  76.  
  77. :2018
  78. set YEAR=2018
  79. set PORT=55378-55382
  80. set PORT1=8019
  81. set PORT2=56728
  82. set FOLDER=Reckon Accounts 2018
  83. set DATAUSER=QBDataServiceUser27
  84. goto CheckOS
  85.  
  86. :2019
  87. set YEAR=2019
  88. set PORT=55383-55387
  89. set PORT1=8019
  90. set PORT2=56729
  91. set FOLDER=Reckon Accounts 2019
  92. set DATAUSER=QBDataServiceUser28
  93. goto CheckOS
  94.  
  95.  
  96. :CheckOS
  97. IF EXIST "%PROGRAMFILES(X86)%" ( GOTO 64Bit ) ELSE ( GOTO 32Bit )
  98.  
  99. :32Bit
  100. set INSTALL=%PROGRAMFILES%
  101. goto Action
  102.  
  103. :64Bit
  104. set INSTALL=%PROGRAMFILES(X86)%
  105. goto Action
  106.  
  107. :Action
  108. ECHO.
  109. ECHO 1.Add %YEAR% Exceptions
  110. ECHO 2.Delete %YEAR% Exceptions
  111. ECHO.
  112.  
  113. CHOICE /C 12 /M "Select a Action:"
  114.  
  115. IF ERRORLEVEL 2 GOTO DeleteExceptions
  116. IF ERRORLEVEL 1 GOTO AddExceptions
  117.  
  118. :AddCommonExceptions
  119. ECHO.
  120. ECHO *** Common Firewall Exceptions ***
  121. ECHO.
  122. ECHO Adding QBCFMonitorService
  123. netsh advfirewall firewall add rule name="Reckon Accounts - QBCFMonitorService" program="%INSTALL%\Common Files\Intuit\QuickBooks\QBCFMonitorService.exe" action=allow program enable=yes dir=in profile=any
  124. ECHO Adding QBUpdate
  125. netsh advfirewall firewall add rule name="Reckon Accounts - QBUpdate" program="%INSTALL%\Common Files\Intuit\QuickBooks\QBUpdate\qbupdate.exe" action=allow program enable=yes dir=in profile=any
  126. GOTO CheckUserGroup
  127.  
  128. :AddExceptions
  129. ECHO.
  130. ECHO *** Firewall Exceptions ***
  131. ECHO.
  132. ECHO Adding %YEAR% - Filemangement
  133. netsh advfirewall firewall add rule name="Reckon Accounts %YEAR% - Filemangement" program="%INSTALL%\Intuit\%FOLDER%\FileManagement.exe" action=allow program enable=yes dir=in profile=any
  134. ECHO Adding %YEAR% - QBDBMgr
  135. netsh advfirewall firewall add rule name="Reckon Accounts %YEAR% - QBDBMgr" program="%INSTALL%\Intuit\%FOLDER%\QBDBMgr.exe" action=allow program enable=yes dir=in profile=any
  136. ECHO Adding %YEAR% - QBDBMgrN
  137. netsh advfirewall firewall add rule name="Reckon Accounts %YEAR% - QBDBMgrN" program="%INSTALL%\Intuit\%FOLDER%\QBDBMgrN.exe" action=allow program enable=yes dir=in profile=any
  138. ECHO Adding %YEAR% - QBGDSPlugin
  139. netsh advfirewall firewall add rule name="Reckon Accounts %YEAR% - QBGDSPlugin" program="%INSTALL%\Intuit\%FOLDER%\QBGDSPlugin.exe" action=allow program enable=yes dir=in profile=any
  140. ECHO Adding %YEAR% - QBW32
  141. netsh advfirewall firewall add rule name="Reckon Accounts %YEAR% - QBW32" program="%INSTALL%\Intuit\%FOLDER%\QBW32.exe" action=allow program enable=yes dir=in profile=any
  142. ECHO Adding %YEAR% - Port:%PORT%
  143. netsh advfirewall firewall add rule name="Reckon Accounts %YEAR% - Port" dir=in action=allow protocol=TCP localport=%PORT%
  144. ECHO Adding %YEAR% - Port:%PORT1%
  145. netsh advfirewall firewall add rule name="Reckon Accounts %YEAR% - Port" dir=in action=allow protocol=TCP localport=%PORT1%
  146. ECHO Adding %YEAR% - Port:%PORT2%
  147. netsh advfirewall firewall add rule name="Reckon Accounts %YEAR% - Port" dir=in action=allow protocol=TCP localport=%PORT2%
  148. ECHO.
  149. ECHO *** Folder Permissions ***
  150. ECHO.
  151. ECHO Adding Folder Permissions - user:%DATAUSER%
  152. icacls "%DATAFOLDER%" /q /t /grant %DATAUSER%:F
  153. GOTO AddCommonExceptions
  154.  
  155. :DeleteCommonCheck
  156. ECHO.
  157. ECHO *** WARNING WARNING WARNING ***
  158. ECHO.
  159.  
  160. CHOICE /C YN /M "You are about to delete common exceptions that may be used by other versions, press N to cancel or Y to continue."
  161.  
  162. IF ERRORLEVEL 2 GOTO CheckUserGroup
  163. IF ERRORLEVEL 1 GOTO DeleteCommonExceptions
  164.  
  165. :DeleteCommonExceptions
  166. ECHO.
  167. ECHO *** Common Firewall Exceptions ***
  168. ECHO.
  169. ECHO Deleting QBCFMonitorService
  170. netsh advfirewall firewall delete rule name="Reckon Accounts - QBCFMonitorService" program="%INSTALL%\Common Files\Intuit\QuickBooks\QBCFMonitorService.exe"
  171. ECHO Deleting QBUpdate
  172. netsh advfirewall firewall delete rule name="Reckon Accounts - QBUpdate" program="%INSTALL%\Common Files\Intuit\QuickBooks\QBUpdate\qbupdate.exe"
  173. GOTO CheckSharing
  174.  
  175. :DeleteExceptions
  176. ECHO.
  177. ECHO *** Firewall Exceptions ***
  178. ECHO.
  179. ECHO Deleting %YEAR% - Filemangement
  180. netsh advfirewall firewall delete rule name="Reckon Accounts %YEAR% - Filemangement" program="%INSTALL%\Intuit\%FOLDER%\FileManagement.exe"
  181. ECHO Deleting %YEAR% - QBDBMgr
  182. netsh advfirewall firewall delete rule name="Reckon Accounts %YEAR% - QBDBMgr" program="%INSTALL%\Intuit\%FOLDER%\QBDBMgr.exe"
  183. ECHO Deleting %YEAR% - QBDBMgrN
  184. netsh advfirewall firewall delete rule name="Reckon Accounts %YEAR% - QBDBMgrN" program="%INSTALL%\Intuit\%FOLDER%\QBDBMgrN.exe"
  185. ECHO Deleting %YEAR% - QBGDSPlugin
  186. netsh advfirewall firewall delete rule name="Reckon Accounts %YEAR% - QBGDSPlugin" program="%INSTALL%\Intuit\%FOLDER%\QBGDSPlugin.exe"
  187. ECHO Deleting %YEAR% - QBW32
  188. netsh advfirewall firewall delete rule name="Reckon Accounts %YEAR% - QBW32" program="%INSTALL%\Intuit\%FOLDER%\QBW32.exe"
  189. ECHO Deleting %YEAR% - QBW32
  190. netsh advfirewall firewall delete rule name="Reckon Accounts %YEAR% - Port" protocol=TCP localport=%PORT%
  191. ECHO Deleting %YEAR% - QBW32
  192. netsh advfirewall firewall delete rule name="Reckon Accounts %YEAR% - Port" protocol=TCP localport=%PORT1%
  193. ECHO Deleting %YEAR% - QBW32
  194. netsh advfirewall firewall delete rule name="Reckon Accounts %YEAR% - Port" protocol=TCP localport=%PORT2%
  195. ECHO.
  196. ECHO *** Folder Permissions ***
  197. ECHO.
  198. ECHO Deleting Folder Permissions - user:%DATAUSER%
  199. icacls "%DATAFOLDER%" /q /t /remove %DATAUSER%
  200. GOTO DeleteCommonCheck
  201.  
  202. :ChangeUserGroup
  203. ECHO.
  204. set /p USERGROUP="Please enter the User Group and press enter:"
  205. ECHO.
  206. ECHO User Group has been set to '%USERGROUP%'
  207. ECHO.
  208. CHOICE /C YNC /M "Is this correct? Y to continue, N to change, C to Cancel"
  209.  
  210. IF ERRORLEVEL 3 GOTO CheckUserGroup
  211. IF ERRORLEVEL 2 GOTO ChangeUserGroup
  212. IF ERRORLEVEL 1 GOTO CheckSharing
  213.  
  214. :CheckUserGroup
  215. set USERGROUP=%DEFAULT_USERGROUP%
  216. ECHO.
  217. ECHO *** USERGROUP PERMISSIONS ***
  218. ECHO.
  219. ECHO The current default UserGroup '%USERGROUP%' will be used to grant rights to your data folder, using 'everyone' is NOT recommended in a Enterprise Environment(Active Directory), consult I.T. Support
  220. ECHO.
  221. CHOICE /C YN /M "Do you wish to change the default usergroup? (Default:%USERGROUP%) press Y to change, N to continue."
  222.  
  223. IF ERRORLEVEL 2 GOTO CheckSharing
  224. IF ERRORLEVEL 1 GOTO ChangeUserGroup
  225.  
  226. :AddSharing
  227. ECHO.
  228. ECHO *** Folder Permissions ***
  229. ECHO.
  230. ECHO Adding Folder Permissions - user:%USERGROUP%
  231. icacls "%DATAFOLDER%" /q /t /grant %USERGROUP%:m
  232. GOTO Finish
  233.  
  234. :DeleteSharing
  235. ECHO.
  236. ECHO *** Folder Permissions ***
  237. ECHO.
  238. ECHO Deleting Folder Permissions - user:%USERGROUP%
  239. icacls "%DATAFOLDER%" /q /t /remove %USERGROUP%
  240. GOTO Finish
  241.  
  242. :CheckSharing
  243. ECHO.
  244. ECHO *** MULTIUSER - SHARED FOLDER PERMISSIONS ***
  245. ECHO.
  246. ECHO The User '%USERGROUP%' will be granted MODIFY rights to your data folder.
  247. ECHO.
  248.  
  249. CHOICE /C YND /M "Change user '%USERGROUP%' data folder permissions, press N to cancel, Y to apply or D to Delete."
  250.  
  251. IF ERRORLEVEL 3 GOTO DeleteSharing
  252. IF ERRORLEVEL 2 GOTO Finish
  253. IF ERRORLEVEL 1 GOTO AddSharing
  254.  
  255. :Finish
  256. ECHO.
  257. ECHO *** %TITLE% - COMPLETED, ORIGINAL SCRIPT BY DANIEL F AND MODIFIED BY PATCHHARRIS***
  258. ECHO.
  259.  
  260. CHOICE /C CE /M "Press E to Exit or C to continue"
  261.  
  262. IF ERRORLEVEL 2 GOTO EOF
  263. IF ERRORLEVEL 1 GOTO Start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement