Paul_Adam
(Lurker)
2006-02-23 07:40 PM
"if ingroup" not working on wyse term

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


Benny69
(MM club member)
2006-02-23 11:15 PM
Re: "if ingroup" not working on wyse term

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



Paul_Adam
(Lurker)
2006-02-24 09:15 AM
Re: "if ingroup" not working on wyse term

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


Arend_
(MM club member)
2006-02-24 09:19 AM
Re: "if ingroup" not working on wyse term

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.


Björn
(Korg Regular)
2006-02-24 09:22 AM
Re: "if ingroup" not working on wyse term

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.


Paul_Adam
(Lurker)
2006-02-24 10:56 AM
Re: "if ingroup" not working on wyse term

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


Björn
(Korg Regular)
2006-02-24 11:02 AM
Re: "if ingroup" not working on wyse term

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 =)


Benny69
(MM club member)
2006-02-24 02:24 PM
Re: "if ingroup" not working on wyse term

glad we could help, cheers.