I like the poetry that I get to make the new year's first blog about a technology that is new to me!
My friend Scott recently asked me to send him a copy of the KiXtart scripts he had created with a client we have in common. In reviewing the scripts, I realized how useful, simple and practical a technology this really is.
The concept of KiXtart is that you can launch it from a network location at log-in and effect changes much more simply than trying to do Organizational Unit changes. In this case, I will show (based on his script) how to determine what script to run and assign drive letters and/or printers based upon Windows domain group memberships.
*It's important to note that the comment notation of KiXtart is a semicolon (;) and I will code with comments accordingly.
*Here's a blog entry from someone more familiar with the topic. This blog answered a few of my questions while I was writing this.
First, we'll determine what part of the network this computer is on. To this end, Scott had used a fairly simple and straight-forward naming strategy for workstation computers, laptops and public kiosks.
;--------------------
;BRANCHING.KIX
;A script run at log-in to determine settings based upon the terminal's name
;First, let's get rid of other drive mappings that were automatically created at login by the domain.
;This will NOT get rid of the drives the user has mapped by hand.
USE "*" /DELETE
;Now, we have users at OFFICE1 and OFFICE2. This could just as easily be departmental, such as SALES, IT and CORPORATE. For expediency, we won't differ based upon terminal type.
;The terminal names contain their location: OFFICE1's laptop 1 is OFFICE1_L_001.
;The scripting allows for common structures like IF/ENDIF and SELECT/ENDSELECT.
;The scripting provides INCLUDE for executing additional scripts.
;The scripting allows for functions that are installed on the server, such as INSTR ("in string").
SELECT
CASE INSTR(@HOSTNAME, "OFFICE1")
INCLUDE "\\myServer\LogInScripts\OFFICE1.KIX"
CASE INSTR(@HOSTNAME, "OFFICE2")
INCLUDE "\\myServer\LogInScripts\OFFICE2.KIX"
END SELECT
QUIT
;--------------------
That's it! That's all there is to a branching KiXtart script.
Now, let's say that OFFICE1 needs drive maps specified and OFFICE2 (a smaller, remote office) only needs the printer specified. Of course, you can mix-and-match these as you see fit, but let's keep it simple!
;--------------------
;OFFICE1.KIX
;The scripting library includes functions to look at the groups this terminal has been granted access to during log-in, such as INGROUP ("in group").
;Standard DOS/NT commands are respected and used, such as USE.
IF INGROUP ("{Group Name}")
USE {Drive Letter}: "{Share path}"
ENDIF
IF INGROUP ("SALES")
USE S: "\\myServer\SALES\"
ENDIF
;--------------------
;--------------------
;OFFICE2.KIX
;The scripting library also provides for the terminals 'Printers and Faxes' preferences with SETDEFAULTPRINTER.
SETDEFAULTPRINTER ("{Printer Name}")
SETDEFAULTPRINTER ("\\myServer\Printer 1")
;--------------------
How easy is that?!
So, you can see how by defining your scripts in pretty general ways you can accomplish a lot! OFFICE1_K_001 (OFFICE1's Kiosk #1, which happens to belong to the SALES group) would follow a path of BRANCHING.KIX (INSTR on "OFFICE1" = True) -> OFFICE1.KIX. That would give it (example) S: pointing to \\myServer\SALES\ as a drive.
Tuesday, January 27, 2009
Subscribe to:
Post Comments (Atom)


0 comments:
Post a Comment