Hallo, für alle.
Ich habe es nach langem Suchen doch noch gefunden! Mit diesem Script kann man das Target abmelden. Die ID wird automatisch ausgelesen und eingesetzt.
@echo off
rem Filename: iscsilogoutsessions.bat
rem Copyright 2006 Overland Storage, Inc. All rights reserved.
rem Pipe the output from the icscicli sessionlist command to the find command
rem to strip out just the session ID lines to a file in the local folder
rem called sid.txt.
rem
iscsicli sessionlist | find /i "Sitzungs-ID" > sid.txt
rem
rem Loop through the text file, grab the session IDs, and log them out
rem
for /f "delims=: tokens=2" %%i in (sid.txt) do iscsicli logouttarget %%i
rem
rem Delete the temporary file that stored the session IDs.
rem
del sid.txt
rem
rem Use the iscsicli logintarget command to log on any required targets.
rem Un-rem the following line, and substitute the target name in the
rem idevice.name0 location. Duplicate this line for any additional targets
rem that need to be logged on.
rem
rem iscsicli logintarget idevice.name0 T * * * * * * * * * * * * * * * 0