Assigning random number to "pager" Active Directory attribute

48 views Asked by At

I work for a school and we use PaperCut for our printing. I'd like to synchronize the "Primary number" on PaperCut with a field in AD (Pager is the one set by default on PaperCut; in AD, it can be found on any profile, under the Telephones tab) and then to make so as to assign a random code to each AD user's pager field.

I've got the sync part figured out, but I can't find how to assign the random code to any AD field (I'm assuming it's somewhere in Microsoft Entra, but for the life of me I can't find it). Ideally, I'd like for every existing user and new user to get assigned a random and unique pager code, which will then be linked to their PaperCut account. Most website that might have been useful for information regarding this are blocked on our network and I'm new to the job (Junior IT Technician). Would you please be able to help me?

1

There are 1 answers

0
ErkinD39 On

You can use get-random powershell cmdlet specifying min max values. To check uniqueness, before committing the random pager no to AD user, you may use get-ADUser -filter powershell cmdlet to look for any user that already contains that number in its pager no field, if the search is negative you may update AD user.