Search found 6 matches

by tryllzhuud
Sat Oct 12, 2019 11:27 am
Forum: PowerShell
Topic: Using Powershell to add iSCSI Targetname and IP..
Replies: 10
Views: 5832

Re: Using Powershell to add iSCSI Targetname and IP..

jvierra wrote:
Sat Oct 12, 2019 11:19 am
"PowerShell in Action Third Edition" by members of the PowerShell development team. Available for all major booksellers and from the publisher -Manning Publications.
Thanks a lot, will definitely go through to improve.

And thanks again for all the help, and guidance.
by tryllzhuud
Sat Oct 12, 2019 10:59 am
Forum: PowerShell
Topic: Using Powershell to add iSCSI Targetname and IP..
Replies: 10
Views: 5832

Re: Using Powershell to add iSCSI Targetname and IP..

You are asking questions that show you have not taken the time to learn PowerShell basics. Please note that it is not possible to learn PowerShell by asking questions in forums. You will get misleading information and never actually learn how to use PowerShell. It is necessary to take a good tutori...
by tryllzhuud
Sat Oct 12, 2019 7:41 am
Forum: PowerShell
Topic: Using Powershell to add iSCSI Targetname and IP..
Replies: 10
Views: 5832

Re: Using Powershell to add iSCSI Targetname and IP..

If the following isn't what you are asking then I am sure I will never guess correctly unless you can figure out how to ask the correct question $initiatorId = Import-CSV C:\Users\Administrator\Desktop\esxiHostsDeployment.csv | Where-Object{ $_.DMK -match 'iSCSI1|iSCSI2'} | ForEach-Object{'IPAddres...
by tryllzhuud
Fri Oct 11, 2019 11:49 pm
Forum: PowerShell
Topic: Using Powershell to add iSCSI Targetname and IP..
Replies: 10
Views: 5832

Re: Using Powershell to add iSCSI Targetname and IP..

To make matters simpler, I have done with GUI what I'm trying to achieve via Powershell so I can explain better.

I have uploaded screenshots here : https://imgur.com/a/UTdjzfX

Thanks for all the assistance.
by tryllzhuud
Fri Oct 11, 2019 11:42 pm
Forum: PowerShell
Topic: Using Powershell to add iSCSI Targetname and IP..
Replies: 10
Views: 5832

Re: Using Powershell to add iSCSI Targetname and IP..

Here is what we have already discussed: Import-CSV -Path C:\Users\Administrator\Desktop\esxiHostsDeployment.csv | ForEach-Object{ Write-Host 'Host-{0} IPAddress:{1}' -f $_.Hosts, ($_.IP) New-IscsiServerTarget -TargetName $_.Hosts -InitiatorId @('IPAddress:' + $_.IP) -WhatIf } Appreciate that, I bel...
by tryllzhuud
Fri Oct 11, 2019 12:39 pm
Forum: PowerShell
Topic: Using Powershell to add iSCSI Targetname and IP..
Replies: 10
Views: 5832

Using Powershell to add iSCSI Targetname and IP..

I have the following script which retrieves IP addresses from a CSV file but does not add them to the -InitiatorId. $csvFile = Import-CSV -Path C:\Users\Administrator\Desktop\esxiHostsDeployment.csv foreach ($NFSRow in $csvFile) { $virtualSwitch = $NFSRow.Switch $vmK = $NFSRow.VMK $ipa = $csvFile | ...