$session = Get-Property $connection "Children" @($j)
#-Begin-----------------------------------------------------------------
#-Includes------------------------------------------------------------
."$PSScriptRoot\COM.ps1"
#-Sub Main------------------------------------------------------------
Function Main() {
$SapGuiAuto = Get-Object( , "SAPGUI")
If ($SapGuiAuto -isnot [__ComObject]) {
Exit
}
$application = Invoke-Method $SapGuiAuto "GetScriptingEngine"
If ($application -isnot [__ComObject]) {
Free-Object $SapGuiAuto
Exit
}
For($i = 0; $i -lt $application.Children().Count(); $i++) {
$connection = Get-Property $application "Children" @($i)
For($j = 0; $j -lt $connection.Children().Count(); $j++) {
$session = Get-Property $connection "Children" @($j)
If ($session.Busy() -eq 1) {
Continue
}
}
}
Free-Object $SapGuiAuto
}
#-Main----------------------------------------------------------------
Main
#-End-------------------------------------------------------------------
#-Begin-----------------------------------------------------------------
#-Includes------------------------------------------------------------
."$PSScriptRoot\COM.ps1"
#-Sub Main------------------------------------------------------------
Function Main() {
$SapGuiAuto = Get-Object( , "SAPGUI")
If ($SapGuiAuto -isnot [__ComObject]) {
Exit
}
$application = Invoke-Method $SapGuiAuto "GetScriptingEngine"
If ($application -isnot [__ComObject]) {
Free-Object $SapGuiAuto
Exit
}
$connections = Get-Property $application "Connections"
ForEach ($connection In $connections) {
$sessions = Get-Property $connection "Sessions"
ForEach ($session In $sessions) {
If ($session.Busy() -eq 1) {
Continue
}
}
}
Free-Object $SapGuiAuto
}
#-Main----------------------------------------------------------------
Main
#-End-------------------------------------------------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 |