私はマルチテナントのSharePointプロビジョニングアプリケーションに取り組んでおり、ほとんどのプロビジョニングにPowershellを使用する予定です。リモートPowershellを使用して、SharePointがインストールされていないサーバーからコマンドレットを呼び出したいと思います。ただし、SharePointコマンドレットを実行する前に、SharePointスナップインを実行スペースにロードする必要があります。残念ながら、ランスペースプールを作成するときに、接続情報とスナップインの両方を提供する方法が見つかりません。
接続のあるランスペースプール
Dim connectionUrl = New Uri(String.Format("http://{0}/wsman/", remoteServer))
Dim connectionInfo = New WSManConnectionInfo(connectionUrl)
Me._runspacePool = RunspaceFactory.CreateRunspacePool(10, 20, connectionInfo)
スナップイン付きのランスペースプール
Dim sessionState = InitialSessionState.Create("Microsoft.Sharepoint.Powershell")
Me._runspacePool = RunspaceFactory.CreateRunspacePool(sessionState)
誰かがこれを行う方法を知っていますか?