Configure an iSCSI target and initiator on Windows Server

Install the iSCSI Target Server role service on the storage server, create an iSCSI virtual disk and map it to a target, then connect to that target from the iSCSI Initiator on the client server over TCP port 3260.

This guide covers both ends with PowerShell and the built-in tools, bringing the new disk online, adding Multipath I/O for redundancy, and fixing the connection problems Microsoft documents.

Configure an iSCSI target and initiator on Windows Server
The initiator on the client server reaches the iSCSI target server over TCP/IP, by default on port 3260. (Image: Microsoft)

Configure iSCSI target and initiator with PowerShell

Run these from an elevated PowerShell window. Replace the server names, path and IQN with your own; the initiator IQN comes from Get-InitiatorPort on the client.

  1. On the storage server, run Install-WindowsFeature FS-iSCSITarget-Server.
  2. Create the LUN: New-IscsiVirtualDisk -Path E:\iSCSIVirtualHardDisk\1.vhdx -Size 100GB.
  3. Create a target that only your client may use: New-IscsiServerTarget -TargetName SQLTarget -InitiatorIds 'IQN:iqn.1991-05.com.microsoft:sql1.contoso.com'.
  4. Map the disk to the target: Add-IscsiVirtualDiskTargetMapping -TargetName SQLTarget -Path E:\iSCSIVirtualHardDisk\1.vhdx.
  5. On the client server, start the initiator service: Start-Service msiscsi and Set-Service msiscsi -StartupType Automatic.
  6. Add the storage server as a portal: New-IscsiTargetPortal -TargetPortalAddress iSCSIServer1.
  7. Run Get-IscsiTarget, copy the target's NodeAddress, then run Connect-IscsiTarget -NodeAddress <NodeAddress> -IsPersistent $true.

The new disk now appears on the client as a raw local disk. Initialise and format it before use (see the disk section below).

iSCSI target, initiator and IQN explained

Component What it is on Windows Server Where you configure it
iSCSI target The storage end. iSCSI Target Server is a role service of File and Storage Services Server Manager, Windows Admin Center or the IscsiTarget PowerShell module
iSCSI virtual disk (LUN) A VHD or VHDX file presented as a block disk; VHDX supports up to 64 TB New-IscsiVirtualDisk on the target server
iSCSI initiator The client end, built into every supported Windows version (service name msiscsi) iSCSI Initiator app or the iSCSI PowerShell module
IQN iSCSI Qualified Name that identifies each initiator and target, such as iqn.1991-05.com.microsoft:sql1.contoso.com Initiator: Configuration tab or Get-InitiatorPort
Target portal The IP address or DNS name and port the initiator discovers targets on (TCP 3260 by default) New-IscsiTargetPortal or the Discovery tab
iSNS Optional discovery database where initiators and targets register iSNS role service

iSCSI requirements on Windows Server

Item Requirement or limit Why it matters
Network port TCP 3260 open between initiator and target Default iSCSI port; discovery and sessions fail without it
Network speed At least 1 Gbps, ideally a dedicated network or QoS Storage traffic competes with client traffic otherwise
Target scale Up to 256 targets and 512 virtual disks per server Plan LUN layout before you create targets
Virtual disk file Must use the .vhdx extension; not on a network, compressed, sparse or transacted folder New-IscsiVirtualDisk refuses other locations
Access control Initiator IDs by IQN, DNS name, IP address, IPv6 address or MAC address Only listed initiators can log in to the target
Authentication CHAP and reverse CHAP supported Adds a shared secret on top of initiator IDs
High availability Shared Fibre Channel, SAS or Storage Spaces Direct storage with a clustered target role A single target server is a single point of failure

Install and configure an iSCSI target on Windows Server

Do this on the server that holds the disks. The target role service can be added from Server Manager, Windows Admin Center or PowerShell; PowerShell is shown because it scripts cleanly.

  1. Open Windows PowerShell as administrator on the storage server.
  2. Run Install-WindowsFeature FS-iSCSITarget-Server to add the iSCSI Target Server role service.
  3. Prepare a data volume for the VHDX files, for example drive E: formatted with NTFS or ReFS.
  4. Create the virtual disk with New-IscsiVirtualDisk -Path E:\iSCSIVirtualHardDisk\1.vhdx -Size 100GB (add -UseFixed for a fixed-size disk).
  5. Create the target and restrict it to your initiator: New-IscsiServerTarget -TargetName SQLTarget -InitiatorIds 'IQN:iqn.1991-05.com.microsoft:sql1.contoso.com'.
  6. To allow a client by address instead, use -InitiatorIds @('IPAddress:10.10.1.1','IPAddress:10.10.1.2').
  7. Assign the disk to the target with Add-IscsiVirtualDiskTargetMapping -TargetName SQLTarget -Path E:\iSCSIVirtualHardDisk\1.vhdx -Lun 0.
  8. Confirm Windows Firewall on the target allows inbound TCP 3260 from the initiator's network.

Every LUN number on one target must be unique. All virtual disks mapped to the same target are visible to any initiator that connects to it.

Create an iSCSI target on Windows Server with New-IscsiServerTarget
Example 2 shows the -InitiatorId parameter, which assigns allowed initiators by IP address when the target is created. (Image: Microsoft)

New-IscsiVirtualDisk fixed, dynamic and differencing VHDX

The disk type is set when you create the VHDX. Fixed disks allocate all space up front; dynamic disks grow as data is written; differencing disks store changes against a parent image, which suits diskless boot of identical servers.

New-IscsiVirtualDisk -UseFixed -Path "E:\iSCSI\data01.vhdx" -Size 100GB

Creates a fixed-size 100 GB VHDX. Drop -UseFixed for a dynamic disk, or use -ParentPath "E:\iSCSI\base.vhdx" -Path "E:\iSCSI\child\diff.vhdx" for a differencing disk. If the file already exists the command fails; import it with Import-IscsiVirtualDisk instead.

You should see: PowerShell returns the new virtual disk object with its Path and Size, and the .vhdx file appears in the folder.

New-IscsiVirtualDisk examples for fixed and differencing VHDX files
Add -UseFixed for a fixed VHDX, or -ParentPath to create a differencing disk from an existing parent VHDX. (Image: Microsoft)

Configure the iSCSI initiator on Windows Server

Do this on the server that will use the storage. The initiator is already part of Windows; only its service needs starting.

  1. Open Windows PowerShell as administrator on the client server.
  2. Run Start-Service msiscsi, then Set-Service msiscsi -StartupType Automatic so the service survives restarts.
  3. Run Get-InitiatorPort and note the NodeAddress; this is the IQN to add to the target's initiator list.
  4. Add the target server as a discovery portal: New-IscsiTargetPortal -TargetPortalAddress iSCSIServer1 (port 3260 is used unless you add -TargetPortalPortNumber).
  5. Run Get-IscsiTarget and confirm your target is listed with IsConnected set to False.
  6. Connect and make it persistent across restarts: Connect-IscsiTarget -NodeAddress <target IQN> -IsPersistent $true.
  7. For CHAP, add -AuthenticationType ONEWAYCHAP -ChapUsername <name> -ChapSecret <secret> to the connect command.

You can review the same settings in the iSCSI Initiator app: the Discovery tab lists portals, Favorite Targets lists persistent connections, and the Configuration tab shows the initiator name.

Connect-IscsiTarget output on the iSCSI initiator showing IsConnected True
Confirm IsConnected reads True after the cmdlet runs; add -IsPersistent $true so the connection is kept. (Image: Microsoft)

Initialize and format the iSCSI disk on the initiator

A newly connected LUN arrives raw. Find it by bus type so you do not touch a local disk by mistake.

  1. List the iSCSI disks: Get-Disk | Where-Object -FilterScript {$_.BusType -Eq "iSCSI"}.
  2. Note the disk Number of the new LUN; its partition style shows as RAW.
  3. Initialise it as GPT: Initialize-Disk -Number 3 (replace 3 with your disk number).
  4. Create a partition with a drive letter: New-Partition -DiskNumber 3 -UseMaximumSize -AssignDriveLetter.
  5. Format it: Format-Volume -DriveLetter T -FileSystem NTFS, using the letter Windows assigned.
  6. Open File Explorer and confirm the new volume is writable.

Enable multipathing (MPIO) with the iSCSI initiator on Windows Server

MPIO opens several iSCSI sessions to the same target over different network paths and presents them as one disk, so a failed adapter or switch does not drop the volume. Give each path its own network adapter on the initiator.

  1. On the initiator, run Install-WindowsFeature Multipath-IO, then restart if Windows asks.
  2. Let the Microsoft DSM claim iSCSI disks: Enable-MSDSMAutomaticClaim -BusType iSCSI.
  3. Set the default load-balancing policy to round robin: Set-MSDSMGlobalDefaultLoadBalancePolicy -Policy RR.
  4. Disconnect any single-path session to the target with Disconnect-IscsiTarget -NodeAddress <target IQN>.
  5. Connect path one: Connect-IscsiTarget -NodeAddress <target IQN> -TargetPortalAddress 10.10.1.10 -InitiatorPortalAddress 10.10.1.21 -IsMultipathEnabled $true -IsPersistent $true.
  6. Connect path two from the second adapter: repeat the command with -TargetPortalAddress 10.10.2.10 -InitiatorPortalAddress 10.10.2.21.
  7. Open MPIO (type mpiocpl in the search bar) and select Discover Multi-Paths to review the claimed device IDs.

Multiple Connections per Session (MCS) is the alternative to MPIO, but it needs explicit support on the target device. MPIO works with the Windows iSCSI Target Server and most SANs through the built-in Microsoft DSM.

iSCSI MPIO on Windows Server with one session per network path
With MPIO each path gets its own iSCSI session, and the Microsoft DSM presents them as a single disk. (Image: Microsoft)

Check iSCSI sessions and MPIO paths

  1. Run Get-IscsiTarget on the initiator; IsConnected should read True.
  2. Run Get-IscsiSession and Get-IscsiConnection; with MPIO you should see one session per path.
  3. Run Get-MSDSMAutomaticClaimSettings and confirm iSCSI is set to claim automatically.
  4. At a command prompt, run mpclaim -s -d to list disks owned by the Microsoft DSM and their load-balance policy.
  5. Run Get-Disk | Where-Object -FilterScript {$_.BusType -Eq "iSCSI"} and confirm the disk is Online and shows once, not once per path.

iSCSI initiator cannot connect or disks disconnect

iSCSI disks disconnect or are "surprise removed" (Event ID 157)

Network instability, MPIO misconfiguration, mismatched MTU or jumbo frame settings, or adapters not ready when the iSCSI service starts.

  1. Run Get-NetAdapter and Get-NetAdapterStatistics to check link state and errors.
  2. Make MTU and jumbo frame settings match end to end on adapters, switches and the target.
  3. Run Get-IscsiSession and Get-IscsiConnection to see which paths are down.
  4. Re-create the persistent connection with Connect-IscsiTarget -NodeAddress <target> -TargetPortalAddress <IP> -TargetPortalPortNumber 3260 -IsPersistent $true.
  5. Update network adapter and storage drivers and firmware to vendor-supported versions.

Favorite target does not log in after a restart

The initiator name was changed after the favorite target entry was created, so the entry still uses the old IQN.

  1. Open iSCSI Initiator and select Favorite Targets.
  2. Select the stale entry and select Remove.
  3. Reconnect the target so a new favorite is created with the current initiator name.
  4. Make sure the target's access list contains the current IQN.

Wrong or old target IP addresses in the initiator

Outdated discovery portals or sessions from an earlier configuration.

  1. In iSCSI Initiator, select Discovery, then Refresh.
  2. Select any portal that is wrong or unused and select Remove.
  3. Clear stale sessions with Get-IscsiSession | Remove-IscsiSession, then reconnect.

MPIO shows only one path

Both sessions use the same network adapter, or the second session was not opened with multipath enabled.

  1. Assign each iSCSI connection to a different initiator adapter with -InitiatorPortalAddress.
  2. Rebuild the connections with -IsMultipathEnabled $true.
  3. Run mpclaim -s -d again to confirm both paths.

The iSCSI disk stays offline after connecting

The storage area network (SAN) policy keeps new shared disks offline.

  1. Open Command Prompt as administrator and run diskpart.
  2. At the DISKPART prompt, run san policy=OnlineAll.
  3. Reconnect the target or bring the disk online in Disk Management.

Windows Server iSCSI target and initiator FAQ

What port does iSCSI use on Windows Server?

iSCSI uses TCP port 3260 by default. Allow it through the firewall between initiator and target, and add -TargetPortalPortNumber to New-IscsiTargetPortal only if your target listens on a different port.

How do I find the iSCSI initiator IQN on Windows Server?

Run Get-InitiatorPort in PowerShell and read the NodeAddress column, or open the iSCSI Initiator app and check the Configuration tab. The default form is iqn.1991-05.com.microsoft: followed by the computer's FQDN.

Is the iSCSI initiator installed by default on Windows Server?

Yes. Every supported version of Windows includes the iSCSI initiator. You only need to start the msiscsi service and set it to start automatically before connecting to a target.

What is the PowerShell feature name for iSCSI Target Server?

The role service name is FS-iSCSITarget-Server. Install it with Install-WindowsFeature FS-iSCSITarget-Server on the server that will host the iSCSI virtual disks.

How large can an iSCSI virtual disk be on Windows Server?

iSCSI Target Server stores LUNs as VHD or VHDX files, and VHDX supports up to 64 TB. One server supports up to 256 iSCSI targets and 512 virtual disks.

Should I use MPIO or MCS for iSCSI redundancy?

Use MPIO in most cases. It opens separate sessions over different paths and works with the built-in Microsoft DSM, while Multiple Connections per Session needs explicit support on the iSCSI target device.

Can non-Windows initiators connect to a Windows iSCSI target?

Yes. iSCSI Target Server supports non-Microsoft iSCSI initiators, so Linux hosts and hypervisors can use Windows Server as block storage. Add their IQN or IP address to the target's initiator list.

How do I make an iSCSI connection survive a restart?

Add -IsPersistent $true to Connect-IscsiTarget. The session then reconnects automatically after each restart, and the iSCSI Initiator app lists it under Favorite Targets.

Philip Celasco

Philip is a Texas-based technology writer and IT administrator at Techdows.com with more than 10 years of experience creating practical content for everyday users and professionals. He specializes in web browsers, particularly Chromium-based platforms such as Google Chrome, Microsoft Edge, Brave, and Opera. Through his work as an IT administrator, Philip has hands-on experience managing devices, configuring browser policies, troubleshooting software and network issues, and helping people resolve problems that affect productivity and security. His articles are based on practical testing and real-world technical experience. He covers browser settings, extensions, performance problems, privacy controls, security features, and Windows troubleshooting. Outside work, Philip enjoys the quieter side of life in Texas and stepping away from the screen when he can. He has two kids, two cats and loves to play golf with his mother during the weekends.

Leave a Reply

Your email address will not be published. Required fields are marked *