SNC scripts are read from an NFS server in the Solstice Network Client network. Using SNC scripts, clients can access system policies, user profiles, logon scripts, and other SNC scripts stored on an NFS server.
In a PC-Admin network, SNC scripts are used to manage and control the environment of PC-Admin clients. These scripts can be adapted to manage Windows 95 and Windows NT client in a Solstice network. The SNC scripts and the script interpreter should be copied to the /opt/MSPolicy directory on the authentication server.
This section:
Compares PC-Admin SNC scripts on PC-Admin and Solstice Network Client computers
Describes how to run existing SNC scripts on Windows 95 and Windows NT systems running Solstice Network Client software
Describes how to run the script interpreter, using the sunwrun command.
For detailed information on SNC script directives, turn to Appendix C, SNC Script Directives.
Table 6-1 compares scripting features on PC-Admin client and Solstice Network Client computers.
Table 6-1 Comparison of Features on PC-Admin Client and Solstice Network Client
Script Feature |
PC-Admin Clients |
Solstice Network Clients |
---|---|---|
Script server |
Any NFS server designated by DHCP |
A server running the rpc.pcnfsd software. |
Location of scripts on the server |
Stored in the DHCP databases. |
\opt\MSPolicy, which is created on the authentication server. |
Centralized script management |
Yes |
Yes |
Preemptive logon scripts |
Yes |
Yes |
Supported events |
Login, Logout, Boot, Shutdown |
Login on Windows 95 and Windows NT Logout on Windows 95 |
Script hierarchy (Site, Group, User) |
Yes |
Yes |
Scripts controlled by environment variables |
Yes |
Yes |
Modification of environment variables |
Local and Global |
Local |
Command to remotely set drive mounts |
MOUNT |
MOUNT |
Directives (script commands) |
20 script commands for 16-bit client |
20 script commands for 32-bit client |
Global environment variables |
Yes |
Environment can be passed to LAUNCHed applications only. |
Support for NIS/NIS+ environment variables |
Current User, Current Group, Secondary Group |
Current User, Current Group, Secondary Group
|
If you have created SNC scripts that run in your PC-Admin network, you can run these scripts from any authentication server to manage the 32-bit clients in the Solstice network. The Solstice Network Client software includes a script interpreter (sunwrun.exe) that interprets new SNC scripts or existing PC-Admin SNC scripts. Although there may be minor differences, you should be able to run your existing PC-Admin SNC scripts with no changes. Differences are described in "SNC Scripts on PC-Admin Clients and Solstice NFS Clients".
During installation, the script interpreter is installed on the Solstice Network Client in the directory C:\Program Files\Solstice\Bin\sunwrun.exe. Copy this file to the /opt/MSPolicy directory on the authentication server. The SNC scripts are read from the server and run on the client.
Using SNC scripts, clients can access system policies, user profiles, logon scripts, and other SNC scripts. If you have created scripts for your PC-Admin clients, you can adapt those scripts to run on the client in a Solstice network. To reuse the SNC scripts, use the following procedure.
Copy the SNC scripts to the /opt/MSPolicy directory on the authentication server.
Rename or copy login.snc to either ntlogon.snc (on Windows NT) or winlogon.snc (on Windows 95).
Rename or copy logout.snc to either ntlogout.snc (on Windows NT) or winlogout.snc (on Windows 95).
You can run the script interpreter to develop and debug new scripts. The sunwrun command invokes the script interpreter, which automatically runs the appropriate SNC scripts when the user logs in.
To run the command, type:
sunwrun.exe [-ripn] filename.snc
You can specify multiple file script file names on the command line. Each file name must end with the .snc extension. The interpreter will execute each file in order until a script exits with a non-zero exit code or all files are processed.
Available options include:
-r |
Causes the script interpreter to reset the shared environment before interpreting the first file. |
-i |
Causes the script interpreter to reset the shared environment after interpreting the last file. |
-p |
Causes the script interpreter to execute only files from the location specified in the SNDRIVE variable. |
-n |
Causes the script interpreter to exit immediately after executing the last script file, rather than waiting the default 5 seconds provided to enable the user to view the output. |
While, for the most part, you can run existing PC-Admin SNC scripts unchanged, there are some differences that you should be aware of.
Some commands that were run on PC-Admin clients are ignored by the script interpreter (see "Ignored Script Directives").
New directives read and write to the system Registry (see "New Script Directives for Windows 95 and Windows NT Clients").
Environment variables are handled differently (see "Environment Variables Local to SNC Scripts").
With the addition of NIS+ support, the NIS and NIS+ values are handled differently (see "NIS and NIS+ Changes").
The following directives are ignored by the script interpreter.
Command |
Function in PC-Admin |
---|---|
LOGIN |
Starts the Microsoft Windows Login dialog box |
LOGOUT |
Logs out current user and set current user ID to nobody |
RESERVE |
Prevents users from mounting drives |
EXPORT |
Copies local to global variables |
STOP |
Shuts down client's connection to network |
MOUNT -o preserve |
Prevents user from unmounting a drive or printer |
MOUNT -o type |
Media type (cdrom or std) |
New commands are available that enable you to read and write to the system Registry.
The SET REG command enables you to read values from the system Registry into a variable. This is analogous to the SET NIS command. The keys HKEY_LOCAL_MACHINE may be abbreviated to HKLM and HKEY_CURENT_USER may be abbreviated to HKCU.
The REG directive command enables you to write to the system Registry. This command should be used with great caution.
For example, the command REG NEWKEY keypath creates a new key, and the command REG DELKEY keypath deletes the named key.
Solstice Network Client supports both NIS and NIS+ on Windows 95 and Windows NT clients. The SET NIS directive looks up values in either or both NIS and NIS+, depending on the configuration of the local machine.
To facilitate backward compatibility, you should use NIS table names, unless you KNOW that you are using NIS+ in native (non-yp) mode. If you are using NIS+, do NOT add the trailing org_dir to the table name.
If NIS+ is enabled, table names are converted according to these rules:
The first period in a name is converted to an underscore.
The string org_dir is appended to the name.
For example,
auto.home becomes auto_home.org_dir
passwd becomes passwd.org_dir
If you are adapting PC-Admin scripts, note that the return value from NIS+ can be different from NIS, so you may need to use the SET STR command to alter the result.
The SET STR VAR=# %OTHERVAR and SET STR VAR=* %VAR% directives are useful for this purpose. See the description of SNC directives in "SNC Script Directives".
Environment variables are handled as in PC-Admin, but are preserved across invocations in the Registry. Exported variables (using the EXPORT directive) are not placed in the Windows global environment. However, any application that is started will have the exported variables set in its environment.
In addition to variables explicitly set in the SNC script, the PC-Admin server sets local variables on clients each time a user logs in. For a list of SNC script variables, see "Environment Variables Local to SNC Scripts".
In general, 32-bit applications should use the system Registry for application-specific data and not rely on the environment.