4 Replies Latest reply on Apr 19, 2013 5:16 PM by mtracy

    Syncing Users with userload Command

    Newbie

      I had originally asked this in PHAROS/AD integration issue with batch import, but now I'm thinking it needs it's own post.

       

      What I am trying to do is set up a scheduled task that will add new students into Pharos with an initial balance.  I have tried using the following command:

       

      userload -NT "<domain server>" -PS -RM -DG "StudentsEveryone" -RG -PO "password" -CL "<user with admin rights>" -CP 1;0;0.0;2;2;10.00;3;0;0.0

       

      This command not only adds new users but also updates all of the existing users.  I would like to be able to add only new users and set the initial balance without updating all of the existing users with the set balance.  Anybody know if that is possible and if so, how to do it?  Is there a way to do this with the userload command?

       

      I would use the script that adds new users when they authenticate referenced in another post but, we also have the need to have them already in the system for the direct print printers.

        • Re: Syncing Users with userload Command
          Nic Meadows Ranger

          I'm fairly certain that you can't do this using the standard Pharos userload, there is no option/switch for just insert, it'll always insert and update which is no use to you. (You should run that by Pharos support for confirmation.)

           

          In the past we've written our own stored procedures which are called from scripts (on print start job for direct queues and logon event for spooled queues) The scripts insert a user based upon a data returned from the AD authentication or lookup exe (again we've written our own) The sps check if the user doesn't exist and if they don't exist they are then inserted with a initial credit based upon the group that was returned from the AD lookup/authentication. We also modify existing users based upon whether the accounts are expired/disabled/locked out in AD as well.

          • Re: Syncing Users with userload Command
            Paul LaFollette Guide

            I don't know if this will help, but I'll provide this anyway, since this has a lot to do with how we accomplish what you're talking about.

             

            Our database administrators coded a process using .NET to add/update users (one at a time) directly into the tables of our Pharos SQL database thus being able to include username adding to Pharos as part of the whole scripting our organization uses to add new users to multiple systems in our organization.

             

            I'd think your best bet would be to do a comparison query against your Pharos user database to output what usernames are in your network but not in your Pharos, then batch input that list into Pharos.

             

            Otherwise, Do you have a method to get a list of new users from your Domain?  If so, perhaps you could generate a list of new users which could be input from a CSV in a batch.

            • Re: Syncing Users with userload Command
              Daniel Johns Tracker

              userload -NT "<domain server>" -PS -RM
              -DG "StudentsEveryone" -RG -PO "password" -CL "<user with admin rights>"
              -CP 1;0;0.0;2;2;10.00;3;0;0.0

               

              This command not only adds new users but also
              updates all of the existing users.

               

              Yes, you can use userload.exe from the command line to add users and not touch users already in the database.  More generally, whatever you can do using the "Batch User Load" command in Pharos Administrator, you can also do by calling userload.exe from the command line.

               

              In this case, adding without updating is the default action that userload.exe performs when it isn't told to perform any other action.  To do this, simply call userload.exe without any of the "Action" command line options (no -PD, -PS or -PU).  In your example, to add the new users in the same way as your command line has done but leave the existing users alone, simply delete the "-PS" from your command line, together with whatever other options are rendered meaningless by its removal:

               

              userload -NT "<domain server>" -DG "StudentsEveryone" -PO "password" -CL "<user with admin rights>" -CP 1;0;0.0;2;2;10.00;3;0;0.0

               

              Note that your original command line would, in addition to the actions you mentioned, delete any users that are in the system but not on the domain server (the -RM).  If this deletion or users not in the domain is something you want to do, userload.exe does not support doing that without also updating users that are both in the domain and in the database.