Page 1 of 1 1
Topic Options
#9474 - 2001-06-13 10:45 AM Removing Static mappings
Anonymous
Unregistered


Hello,

We have got static mappings that i want to remove when a certain script is loaded.

i used: use * /delete
that leaves only the IPC$ and the netlogon mapping. Thats normal, but we have a F$ mapping which will not be removed.

What can i do to remove this mapping??

Thanks,

AcidBurn

Top
#9475 - 2001-06-13 05:23 PM Re: Removing Static mappings
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Acidburn -
I am not clear on your problem. You have workstations that have drive letters mapped to '\\server\F$', or there is a drive share on the client labeled 'F$'?
Bill

Top
#9476 - 2001-06-13 05:53 PM Re: Removing Static mappings
Anonymous
Unregistered


We have workstations with a mapping to a \\server\f$

This mapping comes out of another script.
It's a static mapping.

I tryed calling a batch file within the script file who used subst f: /d to delete this static mapping.

But i want it to be dun from within the script.

AcidBurn

Top
#9477 - 2001-06-14 12:02 AM Re: Removing Static mappings
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Acidburn -
This is what I use to delete ALL static mappings on clients. 1st part shows how variable $Priviledge calculated, 2nd part process to remove Persistent Mappings.

Of course, if other script mapping \\server\f$ run after this script, no change will be made.

Bill

BTW: Welcome to the board!


code:

; REM ** 4. Define_user privilege. Note: For 'INGROUP \\@WKSTA' to work properly you must create a Global Domain group,
; REM ** add Admin/Power Users to this group, then add the Global group to local workstation Admin/Power Users groups.
SELECT
CASE INGROUP ("Domain Admins") $Privilege = "Domain Admin"
CASE INGROUP ("\\@WKSTA\Administrators") $Privilege = "Local Admin"
CASE INGROUP ("\\@WKSTA\Power Users") $Privilege = "Power User"
CASE (1) $Privilege = "User"
ENDSELECT

:DelPersistent
; rem ####################################################################
; rem ## Delete Registry Persistent drive mappings. Check in case ##
; rem ## end users add drive mappings outside defined login-script. ##
; rem ## DECREMENTING index is most efficient to insure all removed. ##
; rem ####################################################################

; REM ** Local variables in use by this function are:
$EmailMsg = "Could not delete persistent drive mappings on computer @WKSTA."
$ErrorMsg = "Could not delete persistent drive mappings on computer @WKSTA."
$Err = " "
$RegKey = "HKEY_CURRENT_USER\Network"


IF ((@INWIN = 1) AND ($Privilege = "User"))
$con = WRITELINE (10, "User does not have permissions to delete persistent drive mappings." + $CR)
$Status = $Skip
RETURN
ENDIF


$x2=23 ; REM ** Covers letters D-Z
DO
$RC = ENUMKEY ("$RegKey", $x2)
SELECT
CASE (@ERROR = 0)
DELKEY ("$RegKey\$RC")
SELECT
CASE (@ERROR = 0) $Status = $OK
CASE (@ERROR <> 0) $Err = "1"
ENDSELECT
CASE (@ERROR <> 0) AND ($Err = "1") GOSUB ScriptError RETURN
CASE (1) RETURN
ENDSELECT
$x2=$x2-1
UNTIL $x2 < 0

RETURN



[This message has been edited by bleonard (edited 14 June 2001).]

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.05 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org