problem using in ingroup command from kixtart

hi,
i created a global group "HR" containing the administrator (for testing)
when i run the command

IF INGROUP("Domain Admins") RUN "net use q: \\server\share"  <= the command will be executed

IF INGROUP("DOMAIN\HR") RUN "net use q: \\server\share"  <= the command will NOT BE executed

DOMAIN\HR
HR
..
dont work

does anyone has any idea

tks a lot
karel

LVL 6
karel_jespersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris DentPowerShell DeveloperCommented:

The syntax is wrong for the If Statement.

If InGroup("Domain Admins")
    Use "Q:" "\\server\share"
EndIf

If InGroup("HR")
    Use "Q:" "\\Server\share"
EndIf

I replaced your Run call with the built-in function for drive mapping that Kix uses (Use <drive> <share>). If you prefer you can use the original run command:

If InGroup("Domain Admins")
    Run "net use Q: \\server\share"
EndIf

If InGroup("HR")
    Run "net use Q: \\server\share"
EndIf
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
karel_jespersAuthor Commented:
hi chris,
the source i use works for the Domain Admins
but not for the HR group

any ideay why
karel
0
Chris DentPowerShell DeveloperCommented:

Is HR a distribution group?

The InGroup function only works for security groups.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

karel_jespersAuthor Commented:
HR is a distribution group
0
karel_jespersAuthor Commented:
sorry i mean HR is a security group
0
karel_jespersAuthor Commented:
i tried it already with a security group and a distribution group

HR=global security group
0
Chris DentPowerShell DeveloperCommented:

Which version of Kix are you working with? There shouldn't be any problems with that command, but some of the older versions had bugs with the InGroup command.
0
karel_jespersAuthor Commented:
KiX2001_422 is the version
0
Chris DentPowerShell DeveloperCommented:

Sorry for the late response Karel, had to sleep ;)

Since it works against the Domain Admins group it doesn't look like it's having any problems querying group membership. Do you have any other groups (not builtin) that you can try it with?
0
karel_jespersAuthor Commented:
tks chris dent, things are working now using kixart
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.