| PMUser Class | 
Namespace: PM90SettingsAPI.User
public class PMUser : PMRestrictable
The PMUser type exposes the following members.
| Name | Description | |
|---|---|---|
| Delete | 
            Deletes a user from the User list making them inactive.  Past reporting will remain available.
              | |
| DisableRule | 
            Disables the passed rule for this user if enabled. 
              | |
| EnableRule | 
            Enables the rule for this user. 
              | |
| GetUsers | 
            Returns all active users within the Print Manager Plus database
              | |
| LookupUser | 
            Looks up and returns a PMUser object for the user and domain specified.  User will be added if it doesn't exist yet
              | |
| OverridePrimaryGroup | 
            Overrides the primary group for the user
              | |
| Refresh | 
            Refreshes the user's information, balances, restrictions
              | |
| RefreshRestrictions | 
            Refreshes restriction list applied to this object
              (Inherited from PMRestrictable.) | 
| Name | Description | |
|---|---|---|
| ADField01 | 
            Current Custom AD field value and information for this user
              | |
| ADField02 | 
            Current Custom AD field value and information for this user
              | |
| ADField03 | 
            Current Custom AD field value and information for this user
              | |
| ADField04 | 
            Current Custom AD field value and information for this user
              | |
| ADField05 | 
            Current Custom AD field value and information for this user
              | |
| Balance | 
            The default balance for the user.
              | |
| Balances | 
            A list of all active balances
              | |
| BlackAndWhiteRestriction | 
            The current black and white restriction on this object
              (Inherited from PMRestrictable.) | |
| ColorRestriction | 
            The current Color restriction on this object
              (Inherited from PMRestrictable.) | |
| CopiesRestriction | 
            The current Copies restriction on this object
              (Inherited from PMRestrictable.) | |
| DatabaseID | 
            The user's unique database identifier
              (Overrides PMRestrictableDatabaseID.) | |
| DayTimeRestriction | 
            The current DayTime restriction on this object
              (Inherited from PMRestrictable.) | |
| DomainName | 
            The user's domain name. null for Local / Workgroup users 
              | |
| DuplexRestriction | 
            The current Duplex restriction on this object
              (Inherited from PMRestrictable.) | |
| DuplicateRestriction | 
            The current Duplicate restriction on this object
              (Inherited from PMRestrictable.) | |
| FullName | 
            The user's full name
              | |
| JobCostRestriction | 
            The current Page Costrestriction on this object
              (Inherited from PMRestrictable.) | |
| JobSizeRestriction | 
            The current Job Size restriction on this object
              (Inherited from PMRestrictable.) | |
| PageCountRestriction | 
            The current Page Count restriction on this object
              (Inherited from PMRestrictable.) | |
| PageSizeRestriction | 
            The current PageSize restriction on this object
              (Inherited from PMRestrictable.) | |
| PaidBalance | 
            The default balance for the user.
              | |
| PrimaryGroup | 
            Current Primary group of user
              | |
| Restrictions | 
            Full list of all generic restrictions.
              (Inherited from PMRestrictable.) | |
| Rules | 
            Returns all rules enabled on this user
              | |
| TitleRestriction | 
            The current Title restriction on this object
              (Inherited from PMRestrictable.) | |
| UserName | 
            The user's logon name
              | 
try { PMUser user = PMUser.LookupUser("Administrator", "domain.local"); Console.WriteLine("User Name : " + user.UserName); Console.WriteLine("UserID : " + user.DatabaseID); Console.WriteLine("Full Name : " + user.FullName); Console.WriteLine("Domain Name : " + user.DomainName); //See if user's default balance is set to unlimited printing balance, turn this off if (user.Balance.Unlimited) { user.Balance.SetUnlimited(false); } //Grant user a quota of $10.00 user.Balance.SetBalance(10.0); //Restriction user from printing color user.ColorRestriction.Enable(); //Restriction user from printing more than 10 pages with a custom message and action user.PageCountRestriction.Enable(10, //Max Pages allowed new PMAction("New employees may only print 10 pages at a time", //Custom message PMAction.ActionType.Delete, //Delete job if met true, //Send user an email true //Send user a popup )); //Check current status Console.WriteLine("User {0} has a default balance of {1} and {2} restrictions enabled.",user.UserName, //Check if balance is unlimited, or has an quota user.Balance.Unlimited ? "Unlimited" : user.Balance.Currency.ToString("C"), //count enabled restrictions user.Restrictions.Count(res => res.Enabled)); } //Error handling - See PM90SettingsAPI.Exceptions catch (PMDatabaseConnectionNotFoundException) { Console.WriteLine("No Print Manager Plus database connection exists on this system."); } catch(PMServiceUnreachableException) { Console.WriteLine("The PMTracking service is not running, or is unreachable."); } catch (PMObjectNoFoundException) { Console.WriteLine("The user could not be found or looked up successfully."); } catch (PMException ex) { //other exceptions Console.WriteLine("API Error: " + ex.Message + ex.InnerException != null ? (", The inner exception message is: " + ex.InnerException.Message) : ""); }