summary import { SessionIds , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function deletesTheSpecifiedActiveSession ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const bastionHostName = "bastionhosttenant" ; const sessionIds = { } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const resArray = new Array ( ) ; for await ( let item of client . listDisconnectActiveSessions ( resourceGroupName , bastionHostName , sessionIds ) ) { resArray . push ( item ) ; } console . log ( resArray ) ; } deletesTheSpecifiedActiveSession ( ) . catch ( console . error ) ;