0

これは私の現在の PowerShell コードです。

connect-QADService -service 'view.domain.com' -Credential 'MyDomain\Administrator'

$AllVMs= ( get-QADObject -SearchRoot 'vdi.vmware.int/Servers' -type pae-VM -IncludedProperties ipHostNumber,pae-SIDString )

C# (.net 3.5) でどのように書き直すことができますか?

4

1 に答える 1

0

コード:

DirectoryEntry entry = new DirectoryEntry("LDAP://view.domain.com/OU=Servers,DC=vdi,DC=vmware,DC=int", "domain\\Administrator", "paSSw0rd");

DirectorySearcher ds = new DirectorySearcher(entry);
ds.SearchScope = SearchScope.Subtree;
ds.PropertiesToLoad.AddRange(new String[] { "pae-SIDString", "ipHostNumber" });

魅力のように機能します:)

于 2010-10-12T20:43:41.100 に答える