# Microsoft SCSI Initiator configuration

**URL:** <https://forum.ansible.com/t/microsoft-scsi-initiator-configuration/6124>\
**Category:** Get Help\
**Tags:** windows\
**Created:** [June 1, 2024, 6:23pm UTC](https://forum.ansible.com/t/microsoft-scsi-initiator-configuration/6124 "2024-06-01T18:23:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![khanblr](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@khanblr](https://forum.ansible.com/u/khanblr)\
**Post date:** [June 1, 2024, 6:23pm UTC](https://forum.ansible.com/t/microsoft-scsi-initiator-configuration/6124/1 "2024-06-01T18:23:16Z")

</div>

Not able for find any information for windows on Ansible Module to create the iSCSI initiator.

Could you please provide a sample playbook to configure the ISCSI initiator on Microsoft Windows Server 2019 Edition.

---

<div class="post-metadata">

**Author:** ![LukeCampbell](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/lukecampbell/32/336_2.png) [@LukeCampbell](https://forum.ansible.com/u/LukeCampbell)\
**Post date:** [September 28, 2024, 1:51pm UTC](https://forum.ansible.com/t/microsoft-scsi-initiator-configuration/6124/2 "2024-09-28T13:51:13Z")

</div>

I know this post is older but you can utilize the anisble.windows.win\_ps\_module, ansible.windows.win\_service, and ansible.windows.win\_dsc modules to build a role.

Example:

```auto
---
- name: Add the iSCSIdsc module
  community.windows.win_psmodule:
    name: iSCSIdsc
    state: present
    accept_license: true

- name: Start the iSCSI initiator on server
  ansible.windows.win_service:
    name: MSiSCSI
    start_mode: auto
    state: started

- name: Attach the disks to the server
  ansible.windows.win_dsc:
    resource_name: iSCSIInitiator
    ensure: present
    IsPersistent: true
    NodeAddress: "iqn.1991-05.com.microsoft:{{ node_address }}"
    TargetPortalAddress: "{{ storage_server_fqdn }}"

```
