Logon scriptes for SBS 2008 - mapped drives and printers

Posted on 2010-08-13
Medium Priority
Last Modified: 2012-08-13
I am migrating across a SBS 2003 standard server to SBS 2008 Standard.  The 2003 server used a kix32.kix file to map network drives via a .bat file.  Any idea what I can use in 2008 SBS?

As well as mapping network drives, I would like to map network printers dependent on what PC they log onto.  I have used previously a .vbs script to do this dependent on Security group membership on a 2003 server but not sure if this would work now on a 2008SBS server.
Any help would be appreciated.
Question by:buddles
  • 2
  • 2
  • 2

Accepted Solution

ebooyens earned 1200 total points
ID: 33429663
net use L: \\server\share

that's the simplest way to do it.  How did the logon script run on SBS2003 - using group policy?  You may just want to edit the existing group policy (which would have come across if it's a migration int he same domain) to point it to the new .bat location.  If you need to you can set up different group policy objects for different security groups using filtering.

Your vbs should still work, just edit it with the new paths of the printers.

One thing to bear in mind if the printers are shared from the SBS2008 box is that it's 64-bit, so you'll need to add 32-bit drivers before the clients will just map to it.


Author Comment

ID: 33429789
SBS 2003 used the script by having kix32.bat in the logon script in the users account.  This only mapped the drives dependent on group membership.  Ideally I would like this to still only map the appropriate drive mappings dependent on security groups.  I am assuming the .kix format is no longer valid?

Happy to create a new .vbs script for printers and add it to the group policy to map printers.  Any idea what 2008 GPO this should be added to under logon script?


Expert Comment

ID: 33429912
To be honest I don't know kix at all so not sure.

I usually use Group Policy for logon scripts - create a new one for every security group, filter the GPO by its security group and point that to a single .bat file which does the net use and references the vbs script for printers.  Avoid using the existing GPOs as you can get confused real quickly with which GPOs control which scripts.

The other way of doing it is placing people in different OUs in AD and then linking the GPO to the OUs.  This way you can link it to PC or user OUs, but filtering on security group is the obvious way seeing that you already have this configured.

For the VBS script you should just have to change the server\share names in the existing script

O, and initially you may want to do net use L: /d to delete each drive before mapping it as they might have drives mapped to the old server which won't be replaced if you don't run a /d command
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

LVL 15

Assisted Solution

by:Ben Personick (Previously QCubed)
Ben Personick (Previously QCubed) earned 800 total points
ID: 33435518
Server 2008 64 (and I assume Vista 64, XP 64, and 7 64) will not run IFMEMBER, AFAIK kix32 is basically functioning the same as IFMEMBER and is also a 32bit app.

And naturally you can;t run a 64 bit app on 32 bit client.  It's very simple to check for this in your batch script though because the Windows comand environemnt contains the %Processor_Architecture% variable whcih will say "AMD64" or "x86" if the OS is 64Bit or 32 bit respectively.

I realized you could get around the 32bit limitation by running dsquery commands, however that will only solve the logon for a 64bit Win2k8 server, since you must be an admin, and must have DSQuery present (not installed by default on client machines though available)
However recently I realized there was an even better way to manage this, so since you requested a method I'd whipped it up, see the attached batch script =)

:: Script Name: Net_Check-Group-Membership.bat													  ::
:: Version: 1.0
:: Copyright: Ben Personick 																	  ::
:: Date: 2010-08-14										  										  ::

		SET "GroupStart=FALSE"
		SET "GroupList=_"
		FOR /F "Tokens=1-3 Delims=*" %%U IN ('net user "%username%" /domain 2^>^&1 ') DO CALL :Start-Check-Membership "%%U" "%%V" "%%W"
		SET GroupList=%GroupList:_, =%
		ECHO GroupList for %UserName%: %GroupList%

			CALL :Start-IFMEMBER "Domain Users"
			IF "%ISMEMBER%"=="NO" GOTO :End-Script
			ECHO "%UserName%" Is a Member of "%IFMEMBER%"
			ECHO NET USE A: \\SERVER\Share\Somedir\ /P
			ECHO NET USE H: \\SERVER\Home$\%UserName%\ /P
			ECHO NET USE P: \\SERVER\Share\Public\ /P

			CALL :Start-IFMEMBER "Operations"
			IF "%ISMEMBER%"=="NO" GOTO End-Map-Operations
			ECHO %UserName% Is a Member of %IFMEMBER%
			ECHO NET USE O: \\SERVER\Share\Operations\ /P
			ECHO NET USE L: \\SERVER\Share\Love\ /P

			CALL :Start-IFMEMBER "Domain Admins"
			IF "%ISMEMBER%"=="NO" GOTO End-Map-Domain-Admins
	GOTO End-Script

			FOR %%G IN (%GroupList%) DO IF /I %%G=="%IFMEMBER%" SET "ISMEMBER=YES"
			SET "Term=%~n1"&SET "GroupA=%~n2"&SET "GroupB=%~n2"
			::ECHO "%Term%" "%GroupA%" "%GroupB%"
			IF /I "%GroupStart%"=="FALSE" FOR /F %%F IN ('ECHO "%Term%" ^| Find /I "Group"') DO SET "GroupStart=TRUE"
			IF /I "%GroupStart%" NEQ "FALSE" SET GroupList=%GroupList%, "%GroupA%", "%GroupB%"

	ECHO The Script Is Exiting.

Open in new window


Author Closing Comment

ID: 33625384
Apologies I thought this had been closed off already...
LVL 15
ID: 33628788
thanks for the points! =)

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

The Exchange database may sometimes fail to mount owing to various technical reasons. A dismounted EDB file can be the source of many Exchange errors including mailbox inaccessibility for users. Resolving the root cause of mounting problems becomes …
Organisation is organized in a pattern to flow the day to day business, every application and system is interdepended on each other and when very important “Exchange Server downtime” happened.
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question