独立したセッションを作成する方法

リンク サービスを作成したら、使用する独立したセッションを作成する必要があります。

独立したセッションを作成するには

  1. "独立セッション接続" レコードを作成します。

  2. セッションが作成されたことを検証します。

  3. 新しい接続のプロパティを定義します。

    次のコード サンプルは、独立したセッションを作成する方法を示しています。

Private Sub CreateIndependentSession  
    On error resume next  
'Create the Independent Sessions Connection record.  
    Set Namespace = GetObject("Winmgmts:root\MicrosoftHIS")  
'Validate that the instance was created  
    strQuery = "select * from MsSna_LinkService_IpDlc"  
    ' this is our instance  
    Set instset = Namespace.ExecQuery(strQuery)  
    if ( instset.Count<>1) Then  
        wscript.echo "No instances found for the link service query " & strQuery  
    End If  
    For each inst_ in instSet  
        Set Inst = inst_ ' This is our new instance  
    Next ' end of query workaround     
    ' define independent sessions connection  
    Set ObjClass = Namespace.Get("MsSna_ConnectionIpDlc")  
    Set IndepConn = ObjClass.SpawnInstance_  
    IndepConn.Activation = 0  
    IndepConn.Adapter = "SNAIP1"  
    IndepConn.AllowIncoming = TRUE  
    IndepConn.BackupDLUSCPName = ""  
    IndepConn.BackupDLUSNetName = ""  
    IndepConn.BlockId = "05D"  
    IndepConn.Comment = ""  
    IndepConn.CompressionLevel = 0  
    IndepConn.DLURRetryDelay = 0  
    IndepConn.DLURRetryLimit = 0  
    IndepConn.DLURRetryType = 0  
    IndepConn.DynamicLuDef = TRUE  
    IndepConn.IndepSess = TRUE  
    IndepConn.LocalControlPoint = ""  
    IndepConn.LocalNetName = ""  
    IndepConn.Name = Inst.Name  
    IndepConn.NodeId = "FFFFF"  
    IndepConn.PartnerConnectionName = ""  
    IndepConn.PeerRole = 1  
    IndepConn.PrimDLUSCPName = ""  
    IndepConn.PrimDLUSNetName = ""  
    IndepConn.RemoteAddress = ""  
    IndepConn.RemoteBlockId = ""  
    IndepConn.RemoteControlPoint = ""  
    IndepConn.RemoteEnd = 1  
    IndepConn.RemoteNetName = ""  
    IndepConn.RemoteNodeId = ""  
    IndepConn.RetryDelay = 0  
    IndepConn.RetryLimit = 0  
    IndepConn.Service = strComputerName  
    IndepConn.XIDFormat = 1  
    IndepConn.Put_  
    if Err.Number <> 0 then  
        PrintWMIErrorThenExit Err.Description, Err.Number  
    End If  
End Sub  
  

参照

リンク サービスを作成する方法