PackageManager.FindPackagesForUser(String, String, String) method

Applies to Windows only

Retrieves information about all packages with the specified package name and publisher name, installed for a specific user.

Syntax

Public Function FindPackagesForUser(
  userSecurityId As String,  
  packageName As String,  
  packagePublisher As String 
) As IEnumerable(Of Package)

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.

packageName

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

The package name. This parameter cannot be null.

packagePublisher

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

The package publisher. 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 name and publisher 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 is 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)

 

 

Show:
© 2014 Microsoft