0
Exchange 서버에 액세스 할 때 현재 C#에서 PowerShell을 입력하는 데 어려움을 겪고 있습니다. PowerShell에서 실제 개체 읽기
Collection<PSObject> results;
using (PowerShell powershell = PowerShell.Create()) {
powershell.AddCommand("Get-Mailbox");
runspace.Open();
powershell.Runspace = runspace;
results = powershell.Invoke();
}
가 지금은
PSObject
의 컬렉션을 가지고,하지만 난
Mailbox
-Objects의 컬렉션을 가지고 싶다 : 기본적으로,이 내가 가진 것입니다.
어떻게 변환하나요?
각 PSObject의 TypeNames 속성에는 Deserialized.Microsoft.Exchange.Data.Directory.Management.Mailbox
이라는 항목이 있습니다.이 항목은 내가 원하는 바에 매우 가까이 있습니다. Microsoft.Exchange.Data.Directory.Management.Mailbox
.