Page 1 of 1 1
Topic Options
#157755 - 06/02/23 07:40 PM "if ingroup" not working on wyse term
Paul_Adam Offline
Lurker

Registered: 06/02/23
Posts: 3
Hi,

Im writing a pretty basic script to do printer connections based on AD Group membership -

if ingroup ("CIS-IT")

ADDPRINTERCONNECTION ("\\CIS-PRN\IT")

Endif

Hardly rocket science!! - I have tested this from PC's in the domain and it works fine - we have 60 Wyse Series 9 terminals (running Windows XP Pro Embedded) - and the script refuses to work.

Running it with /d it just returns the first line as being at fault

If I run it without group checking (i.e. ADDPRINTERCONNECTION ("\\CIS-PRN\IT")) it maps the printer fine on the terminal.

Tried with Admin users and just plain users - but no joy - (remember its running embedded XP so it is actually a domain member PC)

Am I being stupid and missing something in the config!!
Any thoughts??

Thanks

Paul Adam

Top
#157756 - 06/02/23 11:15 PM Re: "if ingroup" not working on wyse term
Benny69 Offline
Moderator
*****

Registered: 03/10/29
Posts: 1036
Loc: Lincoln, Ne
Hi Paul_Adam and welcome to korg,
run this on one of the terms in question and let us know what the results are.
Code:

If InGroup("CIS-IT")
? "You are a member of CIS-IT"
Else
? "You are not a member of CIS-IT"
EndIf

_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#157757 - 06/02/24 09:15 AM Re: "if ingroup" not working on wyse term
Paul_Adam Offline
Lurker

Registered: 06/02/23
Posts: 3
err..

"You are not a member of CIS-IT"

me not undertsand why!!

I ran set at a command prompt and it reports that ...
USERDOMAIN=CIS
USERNAME=Administrator

Which is the way it should be - I am also getting access to all network drives etc over the network and can access these printers if I manually install them.

Im going to go over the network config in a bit further detail - just to be sure its not me doing something really stupid!!

Will post back let you know!

Thanks

Paul Adam

Top
#157758 - 06/02/24 09:19 AM Re: "if ingroup" not working on wyse term
Arend_ Moderator Offline
MM club member
*****

Registered: 05/01/17
Posts: 1817
Loc: Hilversum, The Netherlands
You should check the AD and be sure that groups you are a member off. A Domain name is not a group.

try this code and see which groups the user is added to
Code:

$strUserName = "testuser"
$strUserPath = "WinNT://@LDOMAIN/$strUserName,User"
$adsUser = GetObject($strUserPath)
For Each $adsGroup In $adsUser.Groups
? $adsGroup.Name
Next


replace "testuser" with the username of the user your trying to get info off.

Top
#157759 - 06/02/24 09:22 AM Re: "if ingroup" not working on wyse term
Björn Offline
Korg Regular
*****

Registered: 05/12/07
Posts: 950
Loc: Stockholm, Sweden.
Hi Paul.
Like apronk just said, check if you accually in that AD-group. if you're running xp just do a gpresult with the user you are unsure of.
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#157760 - 06/02/24 10:56 AM Re: "if ingroup" not working on wyse term
Paul_Adam Offline
Lurker

Registered: 06/02/23
Posts: 3
Ah ha!

The Wyse terms I have been dealing with werent added to the domain by me.

I just went and flattened one and rejoined it to the domain - low and behold!! - the script runs!

Admittedly the printers dont map through - but thats my group policy kicking in - just need to sort that out and (hopefully) I should be sorted!

I get the feeling someone has been mucking about with local policies on our Wyse terms - havent gone through that yet - but will do some digging

Thanks for your help guys - might still have more questions later - will let you know how I get on (I must also say, its very refreshing to find a forum where pepole actually reply with positive help ....other than "yeah, I have that problem too") - ;-)

Cheers Again

Paul Adam

Top
#157761 - 06/02/24 11:02 AM Re: "if ingroup" not working on wyse term
Björn Offline
Korg Regular
*****

Registered: 05/12/07
Posts: 950
Loc: Stockholm, Sweden.
haha =) Nice to see that some of my input here acctually does anything to help :]

And - "yeah, I have that problem too" - I always have problems because I don't really know how to script, but thanks to the guru's/moderators/users (not like me =) here, some of my coding works. All credit goes to them =)
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#157762 - 06/02/24 02:24 PM Re: "if ingroup" not working on wyse term
Benny69 Offline
Moderator
*****

Registered: 03/10/29
Posts: 1036
Loc: Lincoln, Ne
glad we could help, cheers.
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 131 anonymous users online.
Newest Members
OKCPCS, mprell, Dad24Lads, Cutebear, kstieers
17434 Registered Users

Generated in 0.059 seconds in which 0.039 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org