Link to home
Start Free TrialLog in
Avatar of Bryan Summers
Bryan SummersFlag for United States of America

asked on

Domain Shares

I have a domain running on windows 2003 ent server, the current domain controller was first added as a member server to a window 2000 domain controller and them promoted to a domain controller and the windows 2000 domain controller was demoted to a member server.  Our domain is a primarly has file and printer service installed very few application are manage by the server.  My question is this.....When the win2k dc was setup by a previous admin, when a user logged on to a workstation for the first time, his profile was populated with the current domain shares files/printers..When I moved to the new server as it was promoted from a member server to a domain controller, those same shares were past along, problem is those share dont exist any longer and I have to sit down at each workstation and remove the old shares everytime someone logs on to a workstation that hasn't already been reconfigured (manually by me).  So how do I remove the incorrect information that is being passed to each workstation and add the correct information.
Avatar of starmonkey
starmonkey
Flag of United States of America image

That is going to be tricky, as there are a couple of places the old admin could have caused automatic drive mapping to happen.

Question:  when you remove the share, does is "stay gone" the next time you re-boot or login (try both, it can help track down where the mapping is happining)

If the share stays gone, you are dealing with a persistant mapped drive.

in this case I would reccomend using a batch script in the logon script like so:

net use  f: /delete

for removing the mapped F drive.  You can have multiple lines if there is more than one share.

Let me know if you need help setting the logon script, and I will give you the details
If the bad mapped drive comes back when you login or reboot we have to find the place the drive mapping is happing.  Let me know if this is the case and I can help
Avatar of Burns2007
Burns2007

OPen a users account in AD Users & Computers, and go to the profile tab....is there a login script entry? If so, open that file and have a looka t it (usually a .bat or .vbs file). Go to Start > Run and enter: %logonserver%\netlogon

That is the directory all your login scripts should be.
Avatar of Bryan Summers

ASKER

Ok, to everyone, When the drive is disconnected it doesnt come back because, all users get the new login script that maps the new drives.  The only time the incorrect drives appear is when a user logs into the domain for the first time. Its like its stored in a default share object or something like that.  If you see the new login script run before manually disconnecting the drives you get the already in use error.

Also the same is true with the printers, the incorrect shares from the old win2k server are populated upon first login at a new workstation.. and I have to manually delete the printers and search and install the new ones from the server.  Hope this helps clarify things...Also my login script sets up sets up 7 shared drives that are mapped to drive letters, the old system sets up 8 drives.  The drive that a delete script would have to remove would be f:, g:, h:, m:, p:, s:, t:, y:

thanks....
Bryan
Hi netlinger...

One possibility is that you have a modified 'Default User' profile present on the affected workstations.  Windows uses this to create a profile, in the absence of a local or network copy already in existence, when a new user logs onto a workstation for the first time.

You should take a look for a .bat, or .cmd script in the following locations:

Within the Default User profile - C:\Documents and Settings\Default User\Start Menu\Programs\Startup
Within the Registry: - HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run

To use your login script to remove all previous mappings to those drive letters, (a task which is commonly left within a logon script permanently to ensure desired mappings will succeed), simply copy the below into a section above the one which maps your drives:

Net use f: /d
Net use g: /d
Net use h: /d
Net use m: /d
Net use f: /d
Net use p: /d
Net use s: /d
Net use t: /d
Net use y: /d

Hope this is helpful but, if anything is unclear, don't hesitate to ask.

James
Sorry...  I seem to have thrown an extra line into the above.  (Ignore the 5th line... An additional 'f:' deletion).  It wouldn't cause any problems but, it's just not tidy.

James
You can also get rid of the "dead" printer maps if you use kixtart (free download)
http://www.kixtart.org

put the kix32.exe and kx32.dll in the same folder as the loginscript.
add a plain text file kix.txt cut and paste the code below into the text file:
;;;;;;;;;;;;;;;;;
function DelPrinterConnections()
dim $c,$bk,$conn
$c=0
$bk="HKEY_CURRENT_USER\Printers\Connections"
$conn=enumkey($bk,$c)
while @error=0
 $c=$c+1
 $conn=delkey($bk+"\"+$conn)
 $conn=enumkey($bk,$c)
loop
endfunction

DelPrinterConnections()
DelPrinterConnections()
DelPrinterConnections()
DelPrinterConnections()
DelPrinterConnections()
exit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;

invoke the script by including "kix32.exe kix.txt" in the 1st line of your login script.
this will purge any existing printer connections when a person logs in.

You can also automate mapping of printer in the same kix.txt file like so:

addprinterconnection ("\\<server name>\<printer share name>")

the next time the user logs in the script will delete and re-map your printer(s).
run this scrip for a week or 2 to purge all the old printers.  You can then make the printer mapping permanent by appending /persistant to the the end of the command:

addprinterconnection ("\\<server name>\<printer share name>" /persistant

But frankly, I kind of like the printers added everytime.  Anytime I need to make a change, I change one line in a script, and the client PCs fix themselves.


but is there anyway to locate and remove the old mappings from the server itself.  these solutions seem like a work around to delete printer connections each time a user logs in using the login script.  My log in script works now for anyone who has established themselves as a user of a particular workstation.  Its the Initial mapping that take place when the user profile is created the very first time they login to a workstation that I want to deal with.   And its both the Printers and File Shares that are embedded with the new user profile.  I know that running the scripts will fix it.  I can go in and manually disconnect and delete printers too. and then run the script and the New information is mapped the the user profile.  I would like to not have to work around the mapping but physically remove it. So that it is right the first time and everytime the user logs in.
ASKER CERTIFIED SOLUTION
Avatar of james-barr
james-barr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>is there anyway to locate and remove the old mappings from the server itself?
If you didn't find anything on the server (like a logon script) creating the mapped drives, the drive mapping happend on the client, not the server.  To check the clients, follow james-barrs procedure above (I agree with him that you probably won't find anything).

But even if you did find where the old mapping was happening, the clients will STILL have the drive mapped.

manual maps are persistant by default (they stay mapped between logins).  This map is "stored" on the client, not the server, so there isn't any way of removing it from the server.  I've worked arround this problem with scripts that revove the bogus maps before the uses sees them.

If you create a new test user and login do you see the old drive mapping?
Yes to the test user, the old drive mapping and printer mapping is there.  This will happen even if the machine is brandnew and just added to the domain.  the first time I login to the new machine say as domain admin to set up different things, the old maps are there. So I know its coming from the server initially.


Bryan
Bryan, I'm assuming you're restoring an image to these PC's prior to deployment?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hiya,
I think it's fair-to-say starmonkey and I have made sincere efforts to assist in the resolution of this problem.
We just don't to have gotten much response from netlinger.
James-Barr