Page 1 of 1 1
Topic Options
#189638 - 2008-09-12 03:51 PM Changing desktops based on workstation names and group membership
BrianMarsh Offline
Just in Town

Registered: 2008-09-12
Posts: 2
Hi,

I am struggling a little, have inherited a server which is using Kix that I am not familiar with. We have a new bunch of computers in our school ICT Suite that ideally will display a different desktop depending on the group membership of the pupil logging in (eg Year1, Year 2 etc). This implimentation cannot affect the existing classroom PC's so I am assuming that I need to get the script to run based on the mahine name first and then group membership second.

The new PC's are named ICT-SUITE01 through to ICT-SUITE36


I don't seem to be able to find a way of easily adding a wildcard to the @WRKSTA and the script, when it does run, does not implement on the first login attempt by a user, but does work on subsequent login attempts.

So far, what I have working is


IF @WKSTA=("ICT-SUITE01")
writevalue ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Desktop","\\Server1\desktops\ICT Generic","REG_EXPAND_SZ")
Endif


This, of course, only works on one machine and I find it hard to believe that the correct way to implement a simple generic desktop for all users needs to be repeated for all the PC's!

I have had a bash at trying to create an array of the machines, but that does not work and the lack of error messages or similar does not help.

I haven't even started on the group bit yet...

As you can tell, I am a little flumaxed and hope that someone doesn't mind giving me a pointer in the right direction.

thanks

Brian

Top
#189639 - 2008-09-12 04:05 PM Re: Changing desktops based on workstation names and group membership [Re: BrianMarsh]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
You could use a part of the system name if all effected systems have a part of the name in common like ICT or Room1 or something like it.

This example might help you with that.
 Code:

;Read a part of the system name start at the first character and read three characters.
If SubStr(@WKSTA, 1, 3) = "ICT"
	;do your magic
Else
	;do other magic or do nothing.
EndIf


You can also add all affected systems to an array, check the array and do your magic on the outcome.
 Code:
$computers = "System1","System","System3"

If AScan($computers, @WKSTA)
	;Do your magic here.
Else
	;Do other magic or do nothing.
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#189643 - 2008-09-12 08:48 PM Re: Changing desktops based on workstation names and group membership [Re: Mart]
BrianMarsh Offline
Just in Town

Registered: 2008-09-12
Posts: 2
Cheers,

that's great and works a treat.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 515 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.053 seconds in which 0.023 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