PackageManager.FindPackagesForUser(String, String) method

Applies to Windows only

Retrieves information about a specified family of packages installed for a specific user.

Syntax


public IEnumerable<Package> FindPackagesForUser(
  string userSecurityId, 
  string packageFamilyName
)

Parameters

userSecurityId

Type: System.String [.NET] | Platform::String [C++]

The user security identifier (SID). If this parameter is null, the packages are retrieved for the current user.

packageFamilyName

Type: System.String [.NET] | Platform::String [C++]

The family name of packages to find. This parameter cannot be null.

Return value

Type: IIterable<Package> [C++] | System.Collections.Generic.IEnumerable<Package> [.NET]

If the method succeeds, an enumerable collection of package objects is returned. Each Package object in this collection contains information about the package, including but not limited to its name, publisher, version, and install location. If no packages with the specified package family name are found, this method returns an empty list.

Remarks

This method requires administrative privileges if the user security ID specified is different from the user security ID of the calling user. Otherwise, an AccessDeniedException will be thrown.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Management.Deployment
Windows::Management::Deployment [C++]

Metadata

Windows.winmd

See also

PackageManager
FindPackagesForUser(String)
FindPackagesForUser(String, String, String)

 

 

Show:
© 2014 Microsoft