Page 1 of 1 1
Topic Options
#204283 - 2012-02-13 06:52 AM New Kixtart user
Dariusvw Offline
Fresh Scripter

Registered: 2012-02-11
Posts: 11
Loc: South Africa
Greetings
I found out about Kixtart a few weeks back, and have only started using it last week.
So please go easy on me for the dumb Questions.

I am very happy to read how-To's and the like. I just need to find them.

My 1st script is a simple login scrippt.

 Code:
; *****************
; * DRIVE MAPPING *
; *****************

;Mapped Drive

use Q: "\\zeus\Photos$" 
use O: "\\zeus\staff-pupil$" 
use X: "\\zeus\applications" 
use Y: "\\zeus\%username%$" 

If InGroup ("Group-Admin") 
use R: "\\zeus\Reports$"
use W: "\\zeus\Staffdata$" 
EndIf

If InGroup ("GROUP-Intern") 
use W: "\\zeus\Staffdata$" 
EndIf


I would like to add printers, backgrounds,Proxy and internet settings to this script as well, @ some point.

so
A) Is there a better way to do what i have done with the network Drives?
B) Where would i read up on "LOGIN SCRIPTS" specifically?
C) If you know of any books or internet resources that are good Please let me know.

Thanks

Top
#204284 - 2012-02-13 09:33 AM Re: New Kixtart user [Re: Dariusvw]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Hi and welcome to the board.

Adding drives will work like you posted it would be better to delete them before mapping them. See below. You could get in trouble with the hidden shares because kix variables start with the $ character. You might need to double up the dollar characters if you have issues with drive mappings.

 Code:
; *****************
; * DRIVE MAPPING *
; *****************

;Mapped Drive

Use Q: /delete /persistent
Use Q: "\\zeus\Photos$" 
Use O: /delete /persistent
Use O: "\\zeus\staff-pupil$" 
Use X: /delete /persistent
Use X: "\\zeus\applications" 
Use Y: /delete /persistent
Use Y: "\\zeus\%username%$" 


If InGroup("Group-Admin") 
	Use R: /delete /persistent
	Use R: "\\zeus\Reports$"
	Use W: /delete /persistent
	Use W: "\\zeus\Staffdata$" 
EndIf

If InGroup("GROUP-Intern") 
	Use W: /delete /persistent
	Use W: "\\zeus\Staffdata$" 
EndIf


A cleaner way imho would be to check if the drive exists and if it does check where it links to and fix that if needed. If the drive exists and the path is correct I skip mapping them. This is bit more advanced and it would be better to first learn to walk before trying to run.

Printers:
Adding printers is not that difficult. See the example below.
Please not that AddprinterConnection uses the printer share name and SetDefaultPrinter uses the printer name. I always make sure both names are the same just to avoid issues.

 Code:
If InGroup("SomeGroup")
	$rc = AddPrinterConnection("\\server\printersharename")
EndIf

If InGroup("Someothergroup")
	$rc = SetDefaultPrinter("Printername")
EndIf


The same as for the drive mappings is true for printers. There is a way to check if they are already installed and skip mapping them if they are already there but again, let’s start with the basics.

Wallpaper:

 Code:
$rc = SetWallpaper("pathtowallpaper\wallpaper.bmp")


And again the same is true for this. There are advanced ways of getting this done with for example a check to see if the wallpaper is up to date and copy a new one if it is not. Walk....run.....yada yada... I think you know where I'm going here ;\)

Internet and proxy settings do not belong in a login script imho. There are lots of GPO options for this so I'd suggest using a GPO for Internet Explorer and proxy settings.

I'm not sure if there is a generic logon scripts basics document because there are lots of languages that can be used. I would suggest to browse this board as much as possible and to read this: Fundamentals of programming. Glenn (a long time member of this board) made this and it was useful teaching kixtart to my colleagues and trainees. Just trying in a test setup doesn't hurt also. Yes you may crash and burn sometimes but we all did this at some point and learned from our mistakes…..hopefully


Edited by Mart (2012-02-13 09:37 AM)
Edit Reason: Fixed link to Glenn's site.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#204286 - 2012-02-13 08:31 PM Re: New Kixtart user [Re: Mart]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
The windows .chm help file is the most useful document I've used when it comes to fast and simple syntax help.

You can find the newest version here.
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=202858

Top
#204287 - 2012-02-13 09:45 PM Re: New Kixtart user [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
LOL - Since Mart stole my "Fundamentals of Scripting" thunder, I'll have to scramble a bit. (Thanks, Mart!)

While it doesn't talk about HOW to write a login script, there's a lot of information in the Universal Login Script User Guide that's posted on my web site. It should provide some fuel for your imagination.

One of the most important recommendations I can make is to put your data into an external configuration file. This way, you don't have to edit your script every time some share is added or modified. Your login script impacts every user in your environment, so it has to be "mostly harmless". \:\)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#204288 - 2012-02-14 06:47 AM Re: New Kixtart user [Re: Glenn Barnas]
Dariusvw Offline
Fresh Scripter

Registered: 2012-02-11
Posts: 11
Loc: South Africa
Thanks guys.

Thats a few new resources for me to read through.

I am sure i'll have a few more Q's from time to time.

Top
#204289 - 2012-02-14 11:36 AM Re: New Kixtart user [Re: Dariusvw]
Dariusvw Offline
Fresh Scripter

Registered: 2012-02-11
Posts: 11
Loc: South Africa
with this Code
 Code:
$rc = SetWallpaper("pathtowallpaper\wallpaper.bmp"


When you say Pathtowallpaper.
Is it better to go
X:\wallpaper\photo.JPG
Or
\\server\share\photo.JPG

Thanks

Top
#204290 - 2012-02-14 12:10 PM Re: New Kixtart user [Re: Dariusvw]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
I wouldn't think you would want to set people's wallpaper to a file on a share. I think it might be better to copy the file to the local file system and then set the wallpaper. Are you allowing the users to change the wallpaper then if they don't like what you have chosen?
Top
#204291 - 2012-02-14 01:26 PM Re: New Kixtart user [Re: BradV]
Dariusvw Offline
Fresh Scripter

Registered: 2012-02-11
Posts: 11
Loc: South Africa
\:\)

I work at a school, so no they do not get to change their wallpaper.
90% are on mandatory profiles. maybe 10 of our 120 odd staff constantly work on the same PC where we have given them a few more Rights to do things.

But at the moment all the Pupils just have a plain Blue background.
So i just want to have a "picture" there from time to time. The winning hockey team or some such, and change it from time to time, maybe once a week or so.

I'm kinda trying to make my Job easier while making "IT and computers" more interesting for the students.
What with the school having blocked most of the interesting website the pupils might want to use.


Edited by Dariusvw (2012-02-14 02:07 PM)

Top
#204292 - 2012-02-14 03:29 PM Re: New Kixtart user [Re: Dariusvw]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
OK, that explains the personal "liberty" portion. \:\) The other side of that is just performance. I'm just not sure how often the OS will try to go out and "touch" the file being used for the background image. I would think the most expedient method would be:

1. Configure each system to use a consistent name/location as the background image.
2. In your login script, check the difference between the file on the share and the one on the local computer. If they are different, copy the share to the local system.

Then all you have to do on the server is change the contents of the file to what you want. If you don't want anything displayed, just put an empty file there with the correct name.

Top
#204293 - 2012-02-14 03:32 PM Re: New Kixtart user [Re: BradV]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Several of our clients prohibit background wallpaper, especially in TS/Citrix environments. We use a GPO to force the background to C:\bg.jpg, a file that DOES NOT EXIST!! This simply forces the system to use a specific JPG file that the user cannot change. Works well with no overhead.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#204294 - 2012-02-14 03:50 PM Re: New Kixtart user [Re: Glenn Barnas]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
In fact as an add-on to Glenn's use of GPO, I would recommend:

1. Use GPO to set the name/location.
2. Don't use a login script to change it. Run this from a command script on your server. You don't want them changing their wallpaper in the first place. So, it makes sense to remove it from the login script.

In this way, from the server command script, you either create the c:
bg.jpg file or delete it. Not much to it. \:\)

Top
#204317 - 2012-02-17 03:30 AM Re: New Kixtart user [Re: BradV]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Don't forget your first and most important job (IMHO) is to assist your users with getting done what they need to get done, not simply to control them.

I've worked with Admins that had over 100 policies they applied to their users - luckily I was not in that OU and neither were my users. My users logged in pretty quickly - their users had to go get a cup of coffee when logging in.

Top
#204319 - 2012-02-17 04:07 PM Re: New Kixtart user [Re: NTDOC]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Doc,

I've worked in several banking and financial organizations that require strict control of desktop and email settings. I agree that a large number of GPOs can impact performance - I worked for a client that had over 1200 GPOs and 430 login scripts! (got that down to 16 GPOs and 1 script. ;\) ) Performance there was horrible until we consolidated and eliminated the policies.

The prevention of desktop configuration and user restriction is also critical in an RDP/Citrix environment. Other industries and small businesses may not have the same control requirements, but an image-consious organization will not want potentially offensive (or simply personal statements of politics, religion, or sports) to be interpreted as corporate policy.

I generally have one workstation and one user policy that configures the user environment. These overlay a general computer policy, and may be supplanted by a GPO that further controls specific workstation types, such as laptops or tablets. I also never mix User and Computer settings in a single policy, so I might have a few more than minimally required, but they are smaller and more specific.

Bottom line, if you want to prevent the use of unauthorized desktop images, you must specify the image to use. Simply defining the desktop settings to disabled isn't enough. We found that referencing an image file that does not exist AND is in a path that a user does not have write access to provides the control without any overhead of actually creating and deploying an image file.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#204352 - 2012-02-28 02:35 AM Re: New Kixtart user [Re: Glenn Barnas]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Yes I know there are sites out there like that Glenn especially so now days even more than before (not that I think its a good thing as I don't but it is something that you have to deal with none the less).

It would be really nice if we could stick to real technical issues and drop all the legal who gets to sue who stuff over often trivial nonsense.

Top
#204354 - 2012-02-28 03:05 AM Re: New Kixtart user [Re: NTDOC]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
 Originally Posted By: NTDOC
It would be really nice if we could stick to real technical issues and drop all the legal who gets to sue who stuff over often trivial nonsense.
I agree! Sadly, it ain't the world we live in any more.
_________________________
Actually I am a Rocket Scientist! \:D

Top
#204355 - 2012-02-28 07:09 AM Re: New Kixtart user [Re: Glenn Barnas]
Dariusvw Offline
Fresh Scripter

Registered: 2012-02-11
Posts: 11
Loc: South Africa
My main reason for this all is so that all the machines are the same, no matter where a user logs on. So that the only thing that is different is some icons. Even those i would love to fined away to make them all the same.

Thanks for all the advice

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 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.067 seconds in which 0.022 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