Add-TPUser

231 views 0

Description

Imports users from Active Directory (AD) and enables them for ThinPrint.

Syntax

Add-TPUser -UserIds <Strings>

Parameter Description
-UserIds a list of AD users which can contain the following information:

• user account name (UPN)
or
• Security Account Manager name (SAM)
or
• security identifier (SID)

Example 1

Variable values are indicated in orange.

Add-TPUser -UserIds user5@ourdomain.local, user6@ourdomain.local

 import and activation of user5 and user6

import and activation of user5 and user6

Example 2

$users = $()
$user5 = "ourdomain\user5"
$user6 = "user6@ourdomain.local"
$users = $user5,$user6
Add-TPUser -UserIds $users

import and activation of user5 and user6 per array variable

import and activation of user5 and user6 per array variable

Example 3

The following script is useful when the Manual license activation mode is selected to prevent inadvertently enabling too many ThinPrint licenses. The script synchronizes the ThinPrint-enabled users with members of the ThinPrint AD group. This does not affect Active Directory. Variable values are indicated in orange.

# AD group name (here: ThinPrint)

# Defining variables
$users = @()
$ADGroup = “ThinPrint
$ErrorActionPreference = “Stop”
$TPuserIds = @()
$remusers = @()
# Displaying ThinPrint license info
Get-TPLicenseInfo

# Reading-in the members of the AD group
$ADusers = Get-ADGroupMember -Recursive -Identity $ADGroup -ErrorAction Stop
$ADuserSIDs = $ADusers.SID

##### Script for disabling users for ThinPrint which have been removed from the “ThinPrint” AD group
#####
# Reading-in ThinPrint users from the license server
$TPusers = Get-TPUser
$TPuserIds = $TPusers.UserID

# Test whether ThinPrint users need to be removed
For($i=0;$i -lt $TPuserIds.Count; $i+=1){
If($ADuserSIDs -NotContains $TPuserIds[$i] -and $$ADuserSIDs -ne $null){
$remusers+ =([string]::Format($TPuserIds[$i]))
}
}
$remusers

# Test whether variable with users to deactivate is not empty. If not the users will be deactivated for ThinPrint

If ($remusers){
Remove-TPUser -UserIds $remusers

}

# Displaying ThinPrint license info
Get-TPLicenseInfo

##### Script for enabling users for ThinPrint which have been added to the “ThinPrint” AD group #####

# Enabling new AD users for ThinPrint which are members of the AD group “ThinPrint”
Foreach ($ADUser in $ADusers){
$users += $ADUser.SID.ToString()
}
Add-TPUser -UserIds $users | Select -ExpandProperty Succuess

# Displaying ThinPrint license info
Get-TPLicenseInfo
 import and ThinPrint activation of a user from the ThinPrint AD group and disabling user7, user8, and user9 since they are no longer members of this AD group

import and ThinPrint activation of a user from the ThinPrint AD group and disabling user7, user8, and user9 since they are no longer members of this AD group

Previous Page
Next Page

Was this helpful?