DrUltima, on Apr 7 2006, 01:49 PM, said:
For Users' individual shares, I use the profile in AD. If that fails, I have this as a scripted backup:
IF @HOMESHR=""
COLOR r+/n
? " Notice! No Homeshare Drive defined for @USERID"
ELSE
? " Connecting Drive @HOMEDRIVE to @HOMESHR"
USE @HOMEDRIVE /del
USE @HOMEDRIVE "@HOMESHR"
IF @ERROR < 0
COLOR r+/y+
? ''+@ERROR+' - '+@SERROR
SLEEP 15
COLOR w/n
ENDIF
ENDIF
That's fine for their home drive...and that's the way it should be done. I use the individual part if there's a share specifically for something that only one or two users require access to it.
BTW, you
can use local groups, or server-side groups for the InGroup check, it doesn't have to be a domain group.
If InGroup("@WKSTA\Administrators")
or
If InGroup("\\SERVER\group")
DrUltima, on Apr 7 2006, 01:49 PM, said:
Quote
I have a print server migration script that I used a while back...let me dig that up and I'll post it as well. Done correctly it'll even reset the user's default printer...the move will be completely transparent.
I would love to see this. I did this once before in an old company, but all I had to do was populate a file called printers.ini.
I ended up doing this for the server check, thanks to some help from the KixTart forum:
It's actually quite simple once you get into it. Everything is done with registry checks to see what they currently have set as a default printer, and then what printers they are currently mapping. The script will automatically remap any currently connected printers from the current server to the new server, and then reset the default printer if necessary.
The following code assumes the printer names and share names will stay the same...you're just migrating them from one server to another. If you're renaming the full name or the share name all you have to do is match up the old name with the new name.
Printer 1 = HP LaserJet 8100DTN with a full name of "HR01 (HP 8100DTN)" and a shared name of "HR01" on the current server. Printer name staying the same on the new server.
Printer 2 = HP LaserJet 4250DN with a full name of "LAB01 (HP 4250DN)" and a shared name of "LAB01" on the current server. Printer being renamed on the new server to a full name of "LAB02 (HP 4250DN") and a shared name of "LAB02".
; Read the value for the default printer
$DefPrn = ReadValue("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device")
; If HR01 is mapped on the current print server, remap it to the new print server
If KeyExist("HKCU\Printers\Connections\,,CURRENT_SERVER,HR01 (HP 8100DTN)")
DelPrinterConnection("\\CURRENT_SERVER,HR01 (HP 8100DTN)")
AddPrinterConnection("\\NEW_SERVER\HR01")
; If HR01 was the default printer, reset it as the default printer
If InStr($DefPrn,"\\CURRENT_SERVER\HR01 (HP 8100DTN)")
SetDefaultPrinter("\\NEW_SERVER\HR01 (HP 8100DTN)")
EndIf
EndIf
; If LAB01 is mapped on the current print server, remap it to the new print server
If KeyExist("HKCU\Printers\Connections\,,CURRENT_SERVER,LAB01 (HP 4250DN)")
DelPrinterConnection("\\CURRENT_SERVER,LAB01 (HP 4250DN)")
AddPrinterConnection("\\NEW_SERVER\LAB02")
; If LAB01 was the default printer, reset it as the default printer
If InStr($DefPrn,"\\CURRENT_SERVER\LAB01 (HP 4250DN)")
SetDefaultPrinter("\\NEW_SERVER\LAB02 (HP 4250DN)")
EndIf
EndIf
DrUltima, on Apr 7 2006, 01:49 PM, said:
IF NOT INSTR(@ProductType,'Workstation') AND NOT INSTR(@ProductType,'Professional')
? "Bypassing the login script because you are logging in from a " + @ProductType + "!"
GOTO end;bypassing the rest of this script - I know I could use EXIT, but I like this more.
ELSE
? "Because you are connecting from a @ProductType workstation I am continuing your login script."
ENDIF
The code I posted is exactly the opposite of that. It checks to see if you're logging onto a Member Server or Domain Controller, instead of checking to see if you're logging onto a workstation. I find that a direct check instead of an indirect (NOT) check usually works better.
DrUltima, on Apr 7 2006, 01:49 PM, said:
I had never thought of forcing allowable pop up sites in XPSP2.
Keep in mind that since you have direct access to your group policy settings you can do a lot of this in a GPO. I don't have direct access to the group policy settings for my users (I'm not a domain admin, but I am an admin for one of the organizations on base). I have to get a little more creative when I want to force settings. I do Trusted Sites settings on our logon script as well...but again, you could do this in a GPO.
DrUltima, on Apr 7 2006, 01:49 PM, said:
On the screen saver timeout... Is that in seconds? (probably should be obvious, but I would rather check than assume)
Yep, that's in seconds. 300 seconds is 5 minutes. We're required to have our screensavers set to between 5 and 20 minutes. We're a Customer Service oriented organization and most of our workstations are in high-traffic areas so we went with 5 minutes. This is another setting you could force via Group Policy.
DrUltima, on Apr 7 2006, 01:49 PM, said:
Sure thing!
amfony, on Apr 8 2006, 01:54 AM, said:
off the topic but relevant,
why would we use kix opposed to vbscript/cmd? It seems to be more felixible then cmd, but what is the plus over vbscript?
wscript.echo "Thanks"
With some things it's just a personal preference. KiX was originally designed from the ground up for logon script usage. For a long time it was the only real alternative to CMD. It's grown since then so that you can use it for lots of other things.
For the longest time it was the only real option if you wanted real logon scripts so a lot of people were using it. KiX also has a lot of built-in functionality for doing things such as reading registry values, connecting printers, mapping drives, etc. I know VBScript has these same things, but sometimes it takes less code to do it in KiX. Just for instance:
wscript.echo "Thanks"
vs.
? "Thanks"
To do the same exact thing.
KiX can also do most of the same COM automations calls that VBScript can do. KiX can do WMI calls/reads, read/write text files, Excel Spreadsheets, Access DBs, SQL DBs, etc, etc.