rj07thomas

iSCSI server target in PowerShell

Aug 23rd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #Following 2 variable request IP address and port of target server.
  2. $targetPortalIP = read-host -Prompt "Please enter the IP address for the iSCSI target portal"
  3. $chapSecret = read-host -Prompt "Please enter the CHAP secret"
  4.  
  5. #This line creates a new iSCSI target portal at the specified IP address.
  6. new-iscsitargetportal -TargetPortalAddress $targetPortalIP -TargetPortalPortNumber 3260 -ChapSecret $chapSecret
  7.  
  8. #These are just making life easier- they list the available IQNs
  9. Write-Host ""
  10. Write-Host ""
  11. Write-Host "...and here's a list of the iSCSI targets on that machine"
  12. Write-Host ""
  13. Get-IscsiTarget | Format-List
Advertisement
Add Comment
Please, Sign In to add comment