Page 1 of 1 1
Topic Options
#171815 - 2006-12-20 04:30 PM INGROUP and COMPUTER accounts
sscotter Offline
Lurker

Registered: 2006-08-19
Posts: 1
Loc: West Midlands, UK
Hi all,
I've had a look though both the KIX CHM help files and this forum trying to find out if its possible to test for COMPUTER account group membership?

The scenario is this :-
I have one domain over five sites via VPNs. One site has two sister companys, though they share the same human and computing resources. I want a login script that will set the users wallpaper depending on the computer they're logging on to, not who they are... so they get the right wallpaper regardless of which side of the fence they're sitting on on any particular day.

I've created two "Security Group - Global" groups within the Computers container in the domains AD and added the computer accounts to each group. I have the following snip bit of code :-

Code:
If InGroup("domain\COMPANY1")
   ? "Copying company logo."
   Copy "@LSERVER\NETLOGON\FILES\COMPANY1.bmp" "%USERPROFILE%\company-logo.bmp"
   ? "Setting Wallpaper."
   SetWallpaperV2("%USERPROFILE%\company-logo.bmp",1,0)

EndIf

If InGroup("domain\COMPANY2")
   ? "Copying company logo."
   Copy "@LSERVER\NETLOGON\FILES\COMPANY2.bmp" "%USERPROFILE%\company-logo.bmp"
   ? "Setting Wallpaper."
   SetWallpaperV2("%USERPROFILE%\company-logo.bmp",1,0)

EndIf


I am running KIX32.exe with the /F switch for force a fresh check of group memberships.

I have tried this code with and without domain\ leading the group names, and also with domain\Computer\COMPANYx with no joy.

To state the obvious, the KIX help file does say that INGROUP "Identifies the group(s) in which to check the user's membership". Does INGROUP definately not test for computer account group membership? If thats the case I'll try and create my own function and post it back here.

Any imput greatfully receive!

Have a great Christmas!

Thanks

Steve Scotter

Top
#171818 - 2006-12-20 05:13 PM Re: INGROUP and COMPUTER accounts [Re: sscotter]
craigs9 Offline
Fresh Scripter

Registered: 2006-07-05
Posts: 22
Loc: London, UK
I don't think InGroup will work but I'm sure someone more experienced than me will be able to confirm that.

A way around it though that struck me could be to put the different companies computers in to different OU's and then apply two different policies to the groups.
In the startup script of one policy copy company1.bmp and in the other copy company2.bmp.
Personally I'd call both of the .bmp's the same (or rename afterwards) then set them in the login script as below.

Not a purely kix solution but would expect having the computers in separate OU's would be useful anyway.

Top
#171830 - 2006-12-20 07:32 PM Re: INGROUP and COMPUTER accounts [Re: sscotter]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
No but please look in the UDF forum where there are other methods such as InContainer()
Top
#171833 - 2006-12-20 07:37 PM Re: INGROUP and COMPUTER accounts [Re: NTDOC]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
InCOntainer() does not check group memebership, just OU. There are other UDFs that do check group membership for computer acounts.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#171850 - 2006-12-21 01:53 AM Re: INGROUP and COMPUTER accounts [Re: Les]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Yep, ComputerInGroup()
Top
#171851 - 2006-12-21 02:30 AM Re: INGROUP and COMPUTER accounts [Re: Witto]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Best place to find them.


http://www.kixtart.org/udf/

Top
#171852 - 2006-12-21 02:51 AM Re: INGROUP and COMPUTER accounts [Re: NTDOC]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
yep
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#171914 - 2006-12-22 11:14 AM Re: INGROUP and COMPUTER accounts [Re: craigs9]
maxix Offline
Lurker

Registered: 2006-12-19
Posts: 3
Is it possible to list all Groups a User is in?
Like:

John is in: Sales,EGroup,Internetgroup ?

(Using Samba no ADS)

kind regards
_________________________
MfG Max

Top
#171917 - 2006-12-22 12:15 PM Re: INGROUP and COMPUTER accounts [Re: maxix]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Naughty Maxix!

You've just hijacked this thread, which is bad karma.

Please repost your question in the "Starters" forum as a New Post.

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.074 seconds in which 0.041 seconds were spent on a total of 13 queries. Zlib compression enabled.

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