Session Validation Test by PowerShell
Copyright <2019> Hoon_Jo@dell.com < Github : https://github.com/sysnet4admin>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
0. Pre-Conditions
Inventory
name,IP
Win1pc,192.168.30.174
Win2pc,192.168.30.205
Win3pc,192.168.30.207
Win4pc,192.168.30.211
Win5pc,192.168.30.212
Win6pc,192.168.30.210
Win7pc,192.168.30.206
Win8pc,192.168.30.208
Win9pc,192.168.30.204
win10pc,192.168.30.209
[Host List] NAS_VM_LIST.csv
Topology
1. sleep 30 seconds
1.1. Source Code
$u="krlab.testfslg"
$p=ConvertTo-SecureString "Dell1234!" -AsPlainText -Force
$c=New-Object System.Management.Automation.PSCredential $u,$p
$computer = Import-Csv 'c:tempNAS_VM_LIST.csv'
foreach( $target in $computer ) {
invoke-command -cn $target.name -cred $c {
$net = New-Object -ComObject wscript.network
$net.mapnetworkdrive( "T:", "fluidfs-8p5sb22test01", $false, "krlab.testfslg", "Dell1234!" )
$net.mapnetworkdrive( "Y:", "fluidfs-8p5sb22test02", $false, "krlab.testfslg", "Dell1234!" )
sleep 30
$net.RemoveNetworkDrive("T:", "true", "true")
$net.RemoveNetworkDrive("Y:", "true", "true")
} -asjob
}
[Code 1-1] Show_Version9.yml
1.2. Run the Code
Session Status before running the code.
Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 13:41:42 2019
node0
regular statistics:
Server statistics [level 0]:
Connections [Current: 0] [Maximum: 7]
Sessions [Current: 0] [Maximum: 7]
Tree connects [Current: 0] [Maximum: 21]
Files: [Current: 0] [Maximum: 4]
node1
regular statistics:
Server statistics [level 0]:
Connections [Current: 0] [Maximum: 7]
Sessions [Current: 0] [Maximum: 7]
Tree connects [Current: 0] [Maximum: 19]
Files: [Current: 0] [Maximum: 9]
[Status] Session before running the code
Running the code on PowerShell
PS C:temp> .Session_Test.ps1
Id Name State HasMoreData Location Command
-- ---- ----- ----------- -------- -------
1 Job1 Running True win1pc ...
3 Job3 Running True win2pc ...
5 Job5 Running True win3pc ...
7 Job7 Running True win4pc ...
9 Job9 Running True win5pc ...
11 Job11 Running True win6pc ...
13 Job13 Running True win7pc ...
15 Job15 Running True win8pc ...
17 Job17 Running True win9pc ...
19 Job19 Running True win10pc ...
[Status] running the code
Session Satus after running the code.
Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 13:43:36 2019
node0
regular statistics:
Server statistics [level 0]:
Connections [Current: 6] [Maximum: 7]
Sessions [Current: 6] [Maximum: 7]
Tree connects [Current: 18] [Maximum: 21]
Files: [Current: 0] [Maximum: 4]
node1
regular statistics:
Server statistics [level 0]:
Connections [Current: 4] [Maximum: 7]
Sessions [Current: 4] [Maximum: 7]
Tree connects [Current: 12] [Maximum: 19]
Files: [Current: 0] [Maximum: 9]
[Status] Session after running the code
Session Status after 30seconds.
Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 13:44:05 2019
node0
regular statistics:
Server statistics [level 0]:
Connections [Current: 0] [Maximum: 7]
Sessions [Current: 0] [Maximum: 7]
Tree connects [Current: 0] [Maximum: 21]
Files: [Current: 0] [Maximum: 4]
node1
regular statistics:
Server statistics [level 0]:
Connections [Current: 0] [Maximum: 7]
Sessions [Current: 0] [Maximum: 7]
Tree connects [Current: 0] [Maximum: 19]
Files: [Current: 0] [Maximum: 9]
[Status] Session after 30seconds from running the code.
Check the jobs by ‘get-job’
PS C:temp> get-job
Id Name State HasMoreData Location Command
-- ---- ----- ----------- -------- -------
1 Job1 Completed False win1pc ...
3 Job3 Completed False win2pc ...
5 Job5 Completed False win3pc ...
7 Job7 Completed False win4pc ...
9 Job9 Completed False win5pc ...
11 Job11 Completed False win6pc ...
13 Job13 Completed False win7pc ...
15 Job15 Completed False win8pc ...
17 Job17 Completed False win9pc ...
19 Job19 Completed False win10pc ...
[Status] check the job status after 30seconds
2. sleep 300 seconds
2.1. Source Code
$u="krlab.testfslg"
$p=ConvertTo-SecureString "Dell1234!" -AsPlainText -Force
$c=New-Object System.Management.Automation.PSCredential $u,$p
$computer = Import-Csv 'c:tempNAS_VM_LIST.csv'
foreach( $target in $computer ) {
invoke-command -cn $target.name -cred $c {
$net = New-Object -ComObject wscript.network
$net.mapnetworkdrive( "T:", "fluidfs-8p5sb22test01", $false, "krlab.testfslg", "Dell1234!" )
$net.mapnetworkdrive( "Y:", "fluidfs-8p5sb22test02", $false, "krlab.testfslg", "Dell1234!" )
sleep 300
$net.RemoveNetworkDrive("T:", "true", "true")
$net.RemoveNetworkDrive("Y:", "true", "true")
} -asjob
}
2.2. Run the Code
Session Status before running the code.
Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 13:56:41 2019
node0
regular statistics:
Server statistics [level 0]:
Connections [Current: 0] [Maximum: 7]
Sessions [Current: 0] [Maximum: 7]
Tree connects [Current: 0] [Maximum: 21]
Files: [Current: 0] [Maximum: 4]
node1
regular statistics:
Server statistics [level 0]:
Connections [Current: 0] [Maximum: 7]
Sessions [Current: 0] [Maximum: 7]
Tree connects [Current: 0] [Maximum: 19]
Files: [Current: 0] [Maximum: 9]
[Status] Session before running the code
Running the code on PowerShell
PS C:temp> .Session_Test.ps1
Id Name State HasMoreData Location Command
-- ---- ----- ----------- -------- -------
21 Job21 Running True win1pc ...
23 Job23 Running True win2pc ...
25 Job25 Running True win3pc ...
27 Job27 Running True win4pc ...
29 Job29 Running True win5pc ...
31 Job31 Running True win6pc ...
33 Job33 Running True win7pc ...
35 Job35 Running True win8pc ...
37 Job37 Running True win9pc ...
39 Job39 Running True win10pc ...
[Status] running the code
Session Satus after running the code.
Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 13:57:35 2019
node0
regular statistics:
Server statistics [level 0]:
Connections [Current: 6] [Maximum: 7]
Sessions [Current: 6] [Maximum: 7]
Tree connects [Current: 18] [Maximum: 21]
Files: [Current: 0] [Maximum: 4]
node1
regular statistics:
Server statistics [level 0]:
Connections [Current: 4] [Maximum: 7]
Sessions [Current: 4] [Maximum: 7]
Tree connects [Current: 12] [Maximum: 19]
Files: [Current: 0] [Maximum: 9]
[Status] Session after running the code
Check the jobs by ‘get-job’
PS C:temp> get-job
Id Name State HasMoreData Location Command
-- ---- ----- ----------- -------- -------
39 Job39 Running True win10pc ...
37 Job37 Running True win9pc ...
35 Job35 Running True win8pc ...
33 Job33 Running True win7pc ...
31 Job31 Running True win6pc ...
29 Job29 Running True win5pc ...
27 Job27 Running True win4pc ...
25 Job25 Running True win3pc ...
23 Job23 Running True win2pc ...
21 Job21 Running True win1pc ...
[Status] check the jobs
Session Status after 300seconds.
Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 14:00:05 2019
node0
regular statistics:
Server statistics [level 0]:
Connections [Current: 0] [Maximum: 7]
Sessions [Current: 0] [Maximum: 7]
Tree connects [Current: 0] [Maximum: 21]
Files: [Current: 0] [Maximum: 4]
node1
regular statistics:
Server statistics [level 0]:
Connections [Current: 0] [Maximum: 7]
Sessions [Current: 0] [Maximum: 7]
Tree connects [Current: 0] [Maximum: 19]
Files: [Current: 0] [Maximum: 9]
[Status] Session after 300seconds from running the code.
Check the jobs by ‘get-job’
PS C:temp> get-job
Id Name State HasMoreData Location Command
-- ---- ----- ----------- -------- -------
39 Job39 Completed False win10pc ...
37 Job37 Completed False win9pc ...
35 Job35 Completed False win8pc ...
33 Job33 Completed False win7pc ...
31 Job31 Completed False win6pc ...
29 Job29 Completed False win5pc ...
27 Job27 Completed False win4pc ...
25 Job25 Completed False win3pc ...
23 Job23 Completed False win2pc ...
21 Job21 Completed False win1pc ...
[Status] check the job status after 30seconds
3. Terminating PowerShell window in running state
3.1. Source Code
$u="krlab.testfslg"
$p=ConvertTo-SecureString "Dell1234!" -AsPlainText -Force
$c=New-Object System.Management.Automation.PSCredential $u,$p
$computer = Import-Csv 'c:tempNAS_VM_LIST.csv'
foreach( $target in $computer ) {
invoke-command -cn $target.name -cred $c {
$net = New-Object -ComObject wscript.network
$net.mapnetworkdrive( "T:", "fluidfs-8p5sb22test01", $false, "krlab.testfslg", "Dell1234!" )
$net.mapnetworkdrive( "Y:", "fluidfs-8p5sb22test02", $false, "krlab.testfslg", "Dell1234!" )
sleep 300
$net.RemoveNetworkDrive("T:", "true", "true")
$net.RemoveNetworkDrive("Y:", "true", "true")
} -asjob
}
3.2. Run the Code
Session Status before running the code.
Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 14:02:21 2019
node0
regular statistics:
Server statistics [level 0]:
Connections [Current: 0] [Maximum: 7]
Sessions [Current: 0] [Maximum: 7]
Tree connects [Current: 0] [Maximum: 21]
Files: [Current: 0] [Maximum: 4]
node1
regular statistics:
Server statistics [level 0]:
Connections [Current: 0] [Maximum: 7]
Sessions [Current: 0] [Maximum: 7]
Tree connects [Current: 0] [Maximum: 19]
Files: [Current: 0] [Maximum: 9]
[Status] Session before running the code
Running the code on PowerShell
PS C:temp> .Session_Test.ps1
Id Name State HasMoreData Location Command
-- ---- ----- ----------- -------- -------
21 Job21 Running True win1pc ...
23 Job23 Running True win2pc ...
25 Job25 Running True win3pc ...
27 Job27 Running True win4pc ...
29 Job29 Running True win5pc ...
31 Job31 Running True win6pc ...
33 Job33 Running True win7pc ...
35 Job35 Running True win8pc ...
37 Job37 Running True win9pc ...
39 Job39 Running True win10pc ...
[Status] running the code
Terminating the PowerShell window as above.
Session Satus after running the code.
Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 14:03:25 2019
node0
regular statistics:
Server statistics [level 0]:
Connections [Current: 6] [Maximum: 7]
Sessions [Current: 6] [Maximum: 7]
Tree connects [Current: 18] [Maximum: 21]
Files: [Current: 0] [Maximum: 4]
node1
regular statistics:
Server statistics [level 0]:
Connections [Current: 4] [Maximum: 7]
Sessions [Current: 4] [Maximum: 7]
Tree connects [Current: 12] [Maximum: 19]
Files: [Current: 0] [Maximum: 9]
[Status] Session after running the code
Session Status after 300seconds.
Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 14:07:22 2019
node0
regular statistics:
Server statistics [level 0]:
Connections [Current: 6] [Maximum: 7]
Sessions [Current: 6] [Maximum: 7]
Tree connects [Current: 18] [Maximum: 21]
Files: [Current: 0] [Maximum: 4]
node1
regular statistics:
Server statistics [level 0]:
Connections [Current: 4] [Maximum: 7]
Sessions [Current: 4] [Maximum: 7]
Tree connects [Current: 12] [Maximum: 19]
Files: [Current: 0] [Maximum: 9]
[Status] Session after 300seconds from running the code.
Session Status after 600seconds.
Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 14:12:25 2019
node0
regular statistics:
Server statistics [level 0]:
Connections [Current: 6] [Maximum: 7]
Sessions [Current: 6] [Maximum: 7]
Tree connects [Current: 18] [Maximum: 21]
Files: [Current: 0] [Maximum: 4]
node1
regular statistics:
Server statistics [level 0]:
Connections [Current: 4] [Maximum: 7]
Sessions [Current: 4] [Maximum: 7]
Tree connects [Current: 12] [Maximum: 19]
Files: [Current: 0] [Maximum: 9]
[Status] Session after 30seconds from running the code.
[Important] In fact, this session never expired without other activities.
[Note] Manual Session clear command on support mode.
cliUtil client-access activity active-sessions logoff-SMB-sessions

[Fs8600] nas session validation test_by_hoon_jo

  • 1.
    Session Validation Testby PowerShell Copyright <2019> Hoon_Jo@dell.com < Github : https://github.com/sysnet4admin> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • 2.
    0. Pre-Conditions Inventory name,IP Win1pc,192.168.30.174 Win2pc,192.168.30.205 Win3pc,192.168.30.207 Win4pc,192.168.30.211 Win5pc,192.168.30.212 Win6pc,192.168.30.210 Win7pc,192.168.30.206 Win8pc,192.168.30.208 Win9pc,192.168.30.204 win10pc,192.168.30.209 [Host List]NAS_VM_LIST.csv Topology 1. sleep 30 seconds 1.1. Source Code $u="krlab.testfslg" $p=ConvertTo-SecureString "Dell1234!" -AsPlainText -Force $c=New-Object System.Management.Automation.PSCredential $u,$p $computer = Import-Csv 'c:tempNAS_VM_LIST.csv' foreach( $target in $computer ) { invoke-command -cn $target.name -cred $c {
  • 3.
    $net = New-Object-ComObject wscript.network $net.mapnetworkdrive( "T:", "fluidfs-8p5sb22test01", $false, "krlab.testfslg", "Dell1234!" ) $net.mapnetworkdrive( "Y:", "fluidfs-8p5sb22test02", $false, "krlab.testfslg", "Dell1234!" ) sleep 30 $net.RemoveNetworkDrive("T:", "true", "true") $net.RemoveNetworkDrive("Y:", "true", "true") } -asjob } [Code 1-1] Show_Version9.yml 1.2. Run the Code Session Status before running the code. Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 13:41:42 2019 node0 regular statistics: Server statistics [level 0]: Connections [Current: 0] [Maximum: 7] Sessions [Current: 0] [Maximum: 7] Tree connects [Current: 0] [Maximum: 21] Files: [Current: 0] [Maximum: 4] node1 regular statistics: Server statistics [level 0]: Connections [Current: 0] [Maximum: 7] Sessions [Current: 0] [Maximum: 7] Tree connects [Current: 0] [Maximum: 19] Files: [Current: 0] [Maximum: 9] [Status] Session before running the code Running the code on PowerShell PS C:temp> .Session_Test.ps1 Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 1 Job1 Running True win1pc ... 3 Job3 Running True win2pc ... 5 Job5 Running True win3pc ... 7 Job7 Running True win4pc ... 9 Job9 Running True win5pc ... 11 Job11 Running True win6pc ... 13 Job13 Running True win7pc ... 15 Job15 Running True win8pc ... 17 Job17 Running True win9pc ... 19 Job19 Running True win10pc ... [Status] running the code
  • 4.
    Session Satus afterrunning the code. Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 13:43:36 2019 node0 regular statistics: Server statistics [level 0]: Connections [Current: 6] [Maximum: 7] Sessions [Current: 6] [Maximum: 7] Tree connects [Current: 18] [Maximum: 21] Files: [Current: 0] [Maximum: 4] node1 regular statistics: Server statistics [level 0]: Connections [Current: 4] [Maximum: 7] Sessions [Current: 4] [Maximum: 7] Tree connects [Current: 12] [Maximum: 19] Files: [Current: 0] [Maximum: 9] [Status] Session after running the code Session Status after 30seconds. Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 13:44:05 2019 node0 regular statistics: Server statistics [level 0]: Connections [Current: 0] [Maximum: 7] Sessions [Current: 0] [Maximum: 7] Tree connects [Current: 0] [Maximum: 21] Files: [Current: 0] [Maximum: 4] node1 regular statistics: Server statistics [level 0]: Connections [Current: 0] [Maximum: 7] Sessions [Current: 0] [Maximum: 7] Tree connects [Current: 0] [Maximum: 19] Files: [Current: 0] [Maximum: 9] [Status] Session after 30seconds from running the code. Check the jobs by ‘get-job’ PS C:temp> get-job Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 1 Job1 Completed False win1pc ... 3 Job3 Completed False win2pc ... 5 Job5 Completed False win3pc ... 7 Job7 Completed False win4pc ... 9 Job9 Completed False win5pc ... 11 Job11 Completed False win6pc ... 13 Job13 Completed False win7pc ... 15 Job15 Completed False win8pc ...
  • 5.
    17 Job17 CompletedFalse win9pc ... 19 Job19 Completed False win10pc ... [Status] check the job status after 30seconds 2. sleep 300 seconds 2.1. Source Code $u="krlab.testfslg" $p=ConvertTo-SecureString "Dell1234!" -AsPlainText -Force $c=New-Object System.Management.Automation.PSCredential $u,$p $computer = Import-Csv 'c:tempNAS_VM_LIST.csv' foreach( $target in $computer ) { invoke-command -cn $target.name -cred $c { $net = New-Object -ComObject wscript.network $net.mapnetworkdrive( "T:", "fluidfs-8p5sb22test01", $false, "krlab.testfslg", "Dell1234!" ) $net.mapnetworkdrive( "Y:", "fluidfs-8p5sb22test02", $false, "krlab.testfslg", "Dell1234!" ) sleep 300 $net.RemoveNetworkDrive("T:", "true", "true") $net.RemoveNetworkDrive("Y:", "true", "true") } -asjob } 2.2. Run the Code Session Status before running the code. Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 13:56:41 2019 node0 regular statistics: Server statistics [level 0]: Connections [Current: 0] [Maximum: 7] Sessions [Current: 0] [Maximum: 7] Tree connects [Current: 0] [Maximum: 21] Files: [Current: 0] [Maximum: 4] node1 regular statistics: Server statistics [level 0]: Connections [Current: 0] [Maximum: 7] Sessions [Current: 0] [Maximum: 7] Tree connects [Current: 0] [Maximum: 19]
  • 6.
    Files: [Current: 0][Maximum: 9] [Status] Session before running the code Running the code on PowerShell PS C:temp> .Session_Test.ps1 Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 21 Job21 Running True win1pc ... 23 Job23 Running True win2pc ... 25 Job25 Running True win3pc ... 27 Job27 Running True win4pc ... 29 Job29 Running True win5pc ... 31 Job31 Running True win6pc ... 33 Job33 Running True win7pc ... 35 Job35 Running True win8pc ... 37 Job37 Running True win9pc ... 39 Job39 Running True win10pc ... [Status] running the code Session Satus after running the code. Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 13:57:35 2019 node0 regular statistics: Server statistics [level 0]: Connections [Current: 6] [Maximum: 7] Sessions [Current: 6] [Maximum: 7] Tree connects [Current: 18] [Maximum: 21] Files: [Current: 0] [Maximum: 4] node1 regular statistics: Server statistics [level 0]: Connections [Current: 4] [Maximum: 7] Sessions [Current: 4] [Maximum: 7] Tree connects [Current: 12] [Maximum: 19] Files: [Current: 0] [Maximum: 9] [Status] Session after running the code Check the jobs by ‘get-job’ PS C:temp> get-job Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 39 Job39 Running True win10pc ... 37 Job37 Running True win9pc ... 35 Job35 Running True win8pc ... 33 Job33 Running True win7pc ... 31 Job31 Running True win6pc ... 29 Job29 Running True win5pc ... 27 Job27 Running True win4pc ... 25 Job25 Running True win3pc ... 23 Job23 Running True win2pc ...
  • 7.
    21 Job21 RunningTrue win1pc ... [Status] check the jobs Session Status after 300seconds. Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 14:00:05 2019 node0 regular statistics: Server statistics [level 0]: Connections [Current: 0] [Maximum: 7] Sessions [Current: 0] [Maximum: 7] Tree connects [Current: 0] [Maximum: 21] Files: [Current: 0] [Maximum: 4] node1 regular statistics: Server statistics [level 0]: Connections [Current: 0] [Maximum: 7] Sessions [Current: 0] [Maximum: 7] Tree connects [Current: 0] [Maximum: 19] Files: [Current: 0] [Maximum: 9] [Status] Session after 300seconds from running the code. Check the jobs by ‘get-job’ PS C:temp> get-job Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 39 Job39 Completed False win10pc ... 37 Job37 Completed False win9pc ... 35 Job35 Completed False win8pc ... 33 Job33 Completed False win7pc ... 31 Job31 Completed False win6pc ... 29 Job29 Completed False win5pc ... 27 Job27 Completed False win4pc ... 25 Job25 Completed False win3pc ... 23 Job23 Completed False win2pc ... 21 Job21 Completed False win1pc ... [Status] check the job status after 30seconds 3. Terminating PowerShell window in running state 3.1. Source Code $u="krlab.testfslg" $p=ConvertTo-SecureString "Dell1234!" -AsPlainText -Force $c=New-Object System.Management.Automation.PSCredential $u,$p
  • 8.
    $computer = Import-Csv'c:tempNAS_VM_LIST.csv' foreach( $target in $computer ) { invoke-command -cn $target.name -cred $c { $net = New-Object -ComObject wscript.network $net.mapnetworkdrive( "T:", "fluidfs-8p5sb22test01", $false, "krlab.testfslg", "Dell1234!" ) $net.mapnetworkdrive( "Y:", "fluidfs-8p5sb22test02", $false, "krlab.testfslg", "Dell1234!" ) sleep 300 $net.RemoveNetworkDrive("T:", "true", "true") $net.RemoveNetworkDrive("Y:", "true", "true") } -asjob } 3.2. Run the Code Session Status before running the code. Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 14:02:21 2019 node0 regular statistics: Server statistics [level 0]: Connections [Current: 0] [Maximum: 7] Sessions [Current: 0] [Maximum: 7] Tree connects [Current: 0] [Maximum: 21] Files: [Current: 0] [Maximum: 4] node1 regular statistics: Server statistics [level 0]: Connections [Current: 0] [Maximum: 7] Sessions [Current: 0] [Maximum: 7] Tree connects [Current: 0] [Maximum: 19] Files: [Current: 0] [Maximum: 9] [Status] Session before running the code Running the code on PowerShell PS C:temp> .Session_Test.ps1 Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 21 Job21 Running True win1pc ... 23 Job23 Running True win2pc ... 25 Job25 Running True win3pc ... 27 Job27 Running True win4pc ... 29 Job29 Running True win5pc ... 31 Job31 Running True win6pc ... 33 Job33 Running True win7pc ... 35 Job35 Running True win8pc ... 37 Job37 Running True win9pc ...
  • 9.
    39 Job39 RunningTrue win10pc ... [Status] running the code Terminating the PowerShell window as above. Session Satus after running the code. Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 14:03:25 2019 node0 regular statistics: Server statistics [level 0]: Connections [Current: 6] [Maximum: 7] Sessions [Current: 6] [Maximum: 7] Tree connects [Current: 18] [Maximum: 21] Files: [Current: 0] [Maximum: 4] node1 regular statistics: Server statistics [level 0]: Connections [Current: 4] [Maximum: 7] Sessions [Current: 4] [Maximum: 7] Tree connects [Current: 12] [Maximum: 19] Files: [Current: 0] [Maximum: 9] [Status] Session after running the code Session Status after 300seconds. Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 14:07:22 2019 node0 regular statistics: Server statistics [level 0]: Connections [Current: 6] [Maximum: 7] Sessions [Current: 6] [Maximum: 7] Tree connects [Current: 18] [Maximum: 21] Files: [Current: 0] [Maximum: 4] node1 regular statistics: Server statistics [level 0]: Connections [Current: 4] [Maximum: 7] Sessions [Current: 4] [Maximum: 7] Tree connects [Current: 12] [Maximum: 19] Files: [Current: 0] [Maximum: 9] [Status] Session after 300seconds from running the code. Session Status after 600seconds. Every 5.0s: walknodes all lwio-cli --get-stats Thu Apr 4 14:12:25 2019 node0
  • 10.
    regular statistics: Server statistics[level 0]: Connections [Current: 6] [Maximum: 7] Sessions [Current: 6] [Maximum: 7] Tree connects [Current: 18] [Maximum: 21] Files: [Current: 0] [Maximum: 4] node1 regular statistics: Server statistics [level 0]: Connections [Current: 4] [Maximum: 7] Sessions [Current: 4] [Maximum: 7] Tree connects [Current: 12] [Maximum: 19] Files: [Current: 0] [Maximum: 9] [Status] Session after 30seconds from running the code. [Important] In fact, this session never expired without other activities. [Note] Manual Session clear command on support mode. cliUtil client-access activity active-sessions logoff-SMB-sessions