|
|
|||||||
Hello everyone, I just want to add printers depending on the users group. Users in Group Berlin should get printer1 on serverA: \\serverA\printer1 How do I code this? I am absolutely new to Kixtart! Thanks in advice Davorin |
||||||||
|
|
|||||||
Use the AddPrinterConnection() Function Use also the InGroup() Function Per Example Code: Break On If InGroup("PrinterFirstFloorNorth") AddPrinterConnection("\\PrinterServer\PrinterShareName") SetDefaultPrinter("PrinterName") EndIf For the syntax, see kix2010.doc of the kixtart 4.53 package If Else EndIf = Page 41 InGroup() = Page 80 AddPrinterConnection() = Page 55 SetDefaultPrinter() = page 100 |
||||||||
|
|
|||||||
Thx for the quick and easy answer! That exactly the way I needed and could understand it! :-D |
||||||||
|
|
|||||||
Suppose I want to make it so that the printers are added if they login to a specific computer in a computer lab but in another room. Thanks.. |
||||||||
|
|
|||||||
I think you will have to find good arguments to know which printers you want to map, per example - by computername, or part of it - by username - by security group a user is in - maybe also by Organisational Unit (OU) a user is in (see UDF section) - by network a user or computer is in - ... |
||||||||
|
|
|||||||
I am trying to map a printer based on AD group membership. Here is my problem I am running a W2K3 domain with XP clients. When trying map based on this membership it will not add printer. If I change my member ship to Domain Users it works fine. Now you are probably thinking...Ok he doesn't either hare permission to the printer of the user he is testing with is not a member of this group. I can map the printer manually so permissions are not an issue. I have double and triple checked my member ship. What can I be missing? I have even go to the extent of checking my AD permissions thinking that this user does not have read permission on this group object ;********************Mapping Printers******************* If InGroup ("GBLR_PBLRPR1755") ; "HP OfficeJet ProL7550" ADDPRINTERCONNECTION ("\\PBLRFP01\PBLRPR1755") ? "Added Printer Connection" SetDefaultPrinter ("\\PBLRFP01\PBLRPR1755") endif |
||||||||
|
|
|||||||
What shows on your screen if you run this script? Code: If InGroup ("GBLR_PBLRPR1755") ; "HP OfficeJet ProL7550" $rc = AddPrinterConnection ("\\PBLRFP01\PBLRPR1755") ?@ERROR ?@SERROR $rc = SetDefaultPrinter ("\\PBLRFP01\PBLRPR1755") ?@ERROR ?@SERROR Sleep 10 Else ?"This user is not a member of GBLR_PBLRPR1755" Sleep 10 EndIf |
||||||||
|
|
|||||||
Mart Thanks for you quick reply I get This..... This user is not a member of GBLR_PBLRPR1755 The group GBLR_PBLRPR1755 is brand new I created it yesterday. The Domain Users group of course is a built in group. So I selected a different group other than Domain Users something this user was currently a member of (GSD_Installs) it mapped the printer fine. It looks to me that I may have an AD issue where the logged on user does not have the ability to query the group membership of GBLR_PBLRPR1755 |
||||||||
|
|
|||||||
I'm guessing you need to flush the group token cache. |
||||||||
|
|
|||||||
Les I exected my script with the /f to flush the cache and it still came back This user is not a member of GBLR_PBLRPR1755 Kix32.exe test.kix /f Any other ideas. |
||||||||
|
|
|||||||
Is the user logged on to the same domain as where the group is located? What happens if you add \\yourdomainname\ to the group name? |
||||||||
|
|
|||||||
Are you sure it's a security group? Originally Posted By: dahauss Suppose I want to make it so that the printers are added if they login to a specific computer in a computer lab but in another room. |
||||||||
|
|
|||||||
and how can i check if the printer already exist?! bc i dont want to over add the printer. |
||||||||
|
|
|||||||
You can look in the registry or use one of the available UDFs. |
||||||||
|
|
|||||||
Mart yes it |
||||||||
|
|
|||||||
Sorry Mart I aciidently hit submit Yes it is a securtiy I truely beleive I have an AD issue. It appears to be happening to all newly created groups. One thing that I have left out is that we recently added a DC in our Bangalore India site. This DC is W2K3 R2 where our our other DC are straight W2K3. another thing that I am going to try is the 4.6 Beta version currently I am using the 4.53. |
||||||||
|
|
|||||||
Any updates on this. I have put 4.53 on and then the first time we have a new starter, none of his Printers are mapped. I'm wondering whether this is an AD issue or a 4.53 issue. Does anyone else have any positive results using this function with the AD / 4.53? |
||||||||
|
|
|||||||
Adding printer is working fine with 4.53. Can you show some code? Sure there are issues when you run the script right after the user is created and the domain is not fully replicated yet but that is normal behavior. |
||||||||
|
|
|||||||
I'm wondering whether this is something to do with the speed of our AD then. Our global catalog is 'local' so replication speed shouldn't be an issue. If anyone else has had these issues it'd be worth knowing |