PackageManager.FindPackagesForUser Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
FindPackagesForUser(String) |
Finds all Packages installed for the specified user. |
FindPackagesForUser(String, String) |
Retrieves information about a specified family of Packages installed for a specific user. |
FindPackagesForUser(String, String, String) |
Retrieves information about all Packages with the specified package name and publisher name, installed for a specific user. |
FindPackagesForUser(String)
public:
virtual IIterable<Package ^> ^ FindPackagesForUser(Platform::String ^ userSecurityId) = FindPackagesForUser;
/// [Windows.Foundation.Metadata.Overload("FindPackagesByUserSecurityId")]
IIterable<Package> FindPackagesForUser(winrt::hstring const& userSecurityId);
[Windows.Foundation.Metadata.Overload("FindPackagesByUserSecurityId")]
public IEnumerable<Package> FindPackagesForUser(string userSecurityId);
function findPackagesForUser(userSecurityId)
Public Function FindPackagesForUser (userSecurityId As String) As IEnumerable(Of Package)
Parameters
- userSecurityId
-
String
Platform::String
winrt::hstring
The user security identifier (SID). If this parameter is string.Empty, the packages are retrieved for the current user.
Returns
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.
- Attributes
Windows requirements
App capabilities |
packageQuery
|
Remarks
This method and its overloads require administrative privileges if the user security ID specified is different from the user security ID of the calling user. Otherwise, an AccessDeniedException is thrown. Similar to the FindPackages method, this method and its overloads can be used to enumerate the installed packages for a particular user.
See also
- FindPackagesForUser(String, String)
- FindPackagesForUser(String, String, String)
- Package
- Enumerate app packages by user SID sample
Applies to
FindPackagesForUser(String, String)
public:
virtual IIterable<Package ^> ^ FindPackagesForUser(Platform::String ^ userSecurityId, Platform::String ^ packageFamilyName) = FindPackagesForUser;
/// [Windows.Foundation.Metadata.Overload("FindPackagesByUserSecurityIdPackageFamilyName")]
IIterable<Package> FindPackagesForUser(winrt::hstring const& userSecurityId, winrt::hstring const& packageFamilyName);
[Windows.Foundation.Metadata.Overload("FindPackagesByUserSecurityIdPackageFamilyName")]
public IEnumerable<Package> FindPackagesForUser(string userSecurityId, string packageFamilyName);
function findPackagesForUser(userSecurityId, packageFamilyName)
Public Function FindPackagesForUser (userSecurityId As String, packageFamilyName As String) As IEnumerable(Of Package)
Parameters
- userSecurityId
-
String
Platform::String
winrt::hstring
The user security identifier (SID). If this parameter is String.Empty, the packages are retrieved for the current user.
- packageFamilyName
-
String
Platform::String
winrt::hstring
The family name of packages to find. This parameter cannot be null.
Returns
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.
- Attributes
Windows requirements
App capabilities |
packageQuery
|
See also
Applies to
FindPackagesForUser(String, String, String)
public:
virtual IIterable<Package ^> ^ FindPackagesForUser(Platform::String ^ userSecurityId, Platform::String ^ packageName, Platform::String ^ packagePublisher) = FindPackagesForUser;
/// [Windows.Foundation.Metadata.Overload("FindPackagesByUserSecurityIdNamePublisher")]
IIterable<Package> FindPackagesForUser(winrt::hstring const& userSecurityId, winrt::hstring const& packageName, winrt::hstring const& packagePublisher);
[Windows.Foundation.Metadata.Overload("FindPackagesByUserSecurityIdNamePublisher")]
public IEnumerable<Package> FindPackagesForUser(string userSecurityId, string packageName, string packagePublisher);
function findPackagesForUser(userSecurityId, packageName, packagePublisher)
Public Function FindPackagesForUser (userSecurityId As String, packageName As String, packagePublisher As String) As IEnumerable(Of Package)
Parameters
- userSecurityId
-
String
Platform::String
winrt::hstring
The user security identifier (SID). If this parameter is an empty string (""), the packages are retrieved for the current user.
- packageName
-
String
Platform::String
winrt::hstring
The package name. This parameter cannot be null.
- packagePublisher
-
String
Platform::String
winrt::hstring
The package publisher. This parameter cannot be null.
Returns
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.
- Attributes
Windows requirements
App capabilities |
packageQuery
|