Title: COMException error 0x5011 (S_ADS_ERRORSOCCURRED) while enumerating the PrincipalSearchResult collection returned from System.DirectoryServices.AccountManagetment UserPrincipal:: GetGroups method

 The COMException error 0x5011 (S_ADS_ERRORSOCCURRED) can be thrown when you are enumerating the PrincipalSearchResult collection returned by UserPrincipal::GetGroups method if the UserPrincipal object is initialized with a PrincipalContext of a user in one domain and is attempting to retrieve group membership of a user from a different domain.  The error is generated by the underlying ADSI…

2

How to work around the paging limitation in SQL Link Server when targeting the Active Directory.

When we create a SQL Linked Server to AD, there are certain limitations. For example, we cannot retrieve multivalued attributes from AD. More information on limitations with SQL Linked Server queries can be found in http://support.microsoft.com/kb/299410   As mentioned in the KB article, queries that would return a result set larger than the default page…

0

SDDL form of the SID doesn’t work in Active Directory filter on Windows 2000.

Recently, I was working with a customer who was trying to get the user’s group membership using the TokenGroup attribute. In the VB.Net code, he was using this filter to get the group object back:   Dim sid As String = “S-1-5-21-2146773085-903363285-719344707-606279” searcher.Filter = String.Format(“(&(objectClass=group)(objectSid={0}))”, sid)   In his environment, a few domain controllers were…

0

Create Proxy user in ADAM/AD LDS programmatically

A proxy object is an object in ADAM that represents a security principal in Active Directory. Each proxy object in ADAM contains the SID of a user in Active Directory. Proxy objects (and proxy object classes) do not exist by default in ADAM. However, you can import a proxy object class into the ADAM schema…

3

Retrieving product installation information using WMI via Powershell on a remote machine

The WMI class Win32_product can be used to obtain a list of all the products installed on a remote machine. Below is a PowerShell example of how to use the Win32_Product class to retrieve product information from a remote machine: Get-WmiObject -Class Win32_Product -ComputerName “remotecomputer” | Select-Object __Server , Name , Version , RegCompany ,…

2

Mapping VolumeID to Disk partition Using the DeviceIOControl API

  To map a volume with drive letter to disk partition, one may use some combination of WMI classes like   Win32_LogicalDisk,Win32_LogicalDiskToPartition,Win32_DiskPartition, Win32_DiskDriveToDiskPartition and Win32_DiskDrive.   Unfortunately WMI does not provide a way to map a disk partition that does not have a drive letter associated with it.  There is no WMI class  to associate…

1