# Bulk retrieve config

1. Create a script in **FortiManager -&gt; Device Manager -&gt; Scripts -&gt; Create New**.

<span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![2.png](https://community.fortinet.com/t5/image/serverpage/image-id/34893iFEFE0E78614EBC3D/image-dimensions/798x111/is-moderation-mode/true?v=v2 "2.png")</span></span>

- **Type**: CLI Script.
- **Run script on**: Remote ForitGate Directly (via CLI):

<span style="font-family: courier new,courier;">diagnose fdsm cfg-upload 'comment</span>*' &lt;-----* Any comment can be set, it will be used to identify the retrieve in the revision history.

- Select **OK** to save.

**Note:**

For FortiGates with VDOMs enabled, the script should be modified to this:

**<span style="font-family: courier new,courier;">config global</span>**

**<span style="font-family: courier new,courier;">diagnose fdsm cfg-upload 'comment'</span>**

<div class="mceNonEditable lia-copypaste-placeholder" id="bkmrk-%C2%A0-4"> </div><span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![3.png](https://community.fortinet.com/t5/image/serverpage/image-id/34894i08DEF1FDCAC1E4CB/image-dimensions/700x352/is-moderation-mode/true?v=v2 "3.png")</span></span>

2. Running the script on all FortiGates:

<div class="mceNonEditable lia-copypaste-placeholder" id="bkmrk-%C2%A0-5"> </div><span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![4.png](https://community.fortinet.com/t5/image/serverpage/image-id/34895i906808DA25D0F919/image-dimensions/695x103/is-moderation-mode/true?v=v2 "4.png")</span></span>

- Select the FortiGates and select the right arrow:

<div class="mceNonEditable lia-copypaste-placeholder" id="bkmrk-%C2%A0-6"> </div><span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![5.png](https://community.fortinet.com/t5/image/serverpage/image-id/34896iB782515FFC2D26D6/image-dimensions/700x517/is-moderation-mode/true?v=v2 "5.png")</span></span>

- Select Run:

<span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![run_now.png](https://community.fortinet.com/t5/image/serverpage/image-id/34906i216949B43377B044/image-dimensions/700x525/is-moderation-mode/true?v=v2 "run_now.png")</span></span>

- Select OK:

<span class="lia-inline-image-display-wrapper lia-image-align-center" style="box-sizing: border-box; display: block; max-width: 100%; position: relative; clear: both; margin: auto; width: 700px;"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![<span class='highlight' style='background-color:yellow'>click</span>_ok.png](https://community.fortinet.com/t5/image/serverpage/image-id/34907i64683D757F5CA184/image-dimensions/700x339/is-moderation-mode/true?v=v2 "click_ok.png")</span></span>

- The script will start running:

<span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![start_run.png](https://community.fortinet.com/t5/image/serverpage/image-id/34908iB888708E308DE9D5/image-dimensions/700x353/is-moderation-mode/true?v=v2 "start_run.png")</span></span>

<span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![run_success.png](https://community.fortinet.com/t5/image/serverpage/image-id/34909i16430C960B1D98BD/image-dimensions/701x202/is-moderation-mode/true?v=v2 "run_success.png")</span></span>

3. Go to Device Manager and the configuration status of FortiGates should show synchronized. If any FortiGate is not showing synchronized, 'right-click' on the device and select 'Refresh Device'.

<span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![sunc.png](https://community.fortinet.com/t5/image/serverpage/image-id/34910i142B5C9C3C1C9020/image-dimensions/700x292/is-moderation-mode/true?v=v2 "sunc.png")</span></span>

4. In the Total Revisions for each FortiGate, there will be a 'Retrieve' entry with the 'comment' in the comments section.

<span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![11.png](https://community.fortinet.com/t5/image/serverpage/image-id/34902iFC43E0CE11950394/image-dimensions/700x224/is-moderation-mode/true?v=v2 "11.png")</span></span>

**Note 1:**

Script Status/logs can also be checked from: **System Settings -&gt; Task Monitor**:

<span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![TM.png](https://community.fortinet.com/t5/image/serverpage/image-id/34911i6F7D885761AC07ED/image-dimensions/700x288/is-moderation-mode/true?v=v2 "TM.png")</span></span>

**Note 2:**

Bulk retrieval can also be done by selecting the notification icon on the top, **but it only works if the devices are either in a 'conflict' or 'out-of-sync' state**.

<span class="lia-inline-image-display-wrapper lia-image-align-center"><span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below">![13.png](https://community.fortinet.com/t5/image/serverpage/image-id/34904i1A58BE0343F466CC/image-dimensions/700x314/is-moderation-mode/true?v=v2 "13.png")</span></span>