Page 1 of 1 1
Topic Options
#204671 - 2012-04-09 05:42 PM on some workstations, drive mappings not coming up
Seks Offline
Fresh Scripter

Registered: 2002-10-31
Posts: 20
Not sure why I couldn't post in KiXtart FAQ & How to's???

Anyways, windows 2008 r2 DC and windows 2003 r2 DC.

I've assigned users a batch file in their user account profile which calls the .kix script. I have specified H: to connect to \\srs-edm06\home$\%username% in their AD user account profile.

 Code:
; Breakdown of IP address------------------------------------------------------------------------

$1st_octet = LTRIM(SUBSTR(@ipaddress0,1,3))
$2nd_octet = LTRIM(SUBSTR(@ipaddress0,5,3))
$3rd_octet = LTRIM(SUBSTR(@ipaddress0,9,3))
$4th_octet = LTRIM(SUBSTR(@ipaddress0,13,3))

;-----------------------------------------------------------------------

USE G: /DELETE /PERSISTENT
USE P: /DELETE /PERSISTENT
USE Q: /DELETE /PERSISTENT
USE R: /DELETE /PERSISTENT
USE X: /DELETE /PERSISTENT
USE Y: /DELETE /PERSISTENT
USE Z: /DELETE /PERSISTENT

USE Z: "\\srs.com\dfs\documents"

SELECT
CASE $3rd_octet = 0
	USE P: "\\srs-edm06\public$"
CASE $3rd_octet = 1
	USE P: "\\srs-nisku01\public$"
CASE $3rd_octet = 2
	USE P: "\\srs-edmfab01\public$"
CASE $3rd_octet = 3
	USE P: "\\srs-edmmod01\public$"
ENDSELECT

IF INGROUP("SRS10104 - FTP")
	USE X: "\\SRS10104\FTPROOT"
ENDIF



-------------------------------------------

A few users (windows 7 workstations) are not getting their H: drive mapped. And some are not getting P: or Z: mapped either.

Any ideas why most get their drives mapped but a few are not?????


Edited by Mart (2012-04-09 11:14 PM)
Edit Reason: Please use code tags when posting code.

Top
#204672 - 2012-04-09 06:07 PM Re: on some workstations, drive mappings not coming up [Re: Seks]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
The script is pretty simple and straight forward. Don't see any problems with it. Have you checked the @error state after the USE commands to see if there is an error being generated? Also, have you tried disabling UAC on the win 7 workstations that are having problems to see if that resolves it?

Edited by ShaneEP (2012-04-09 06:08 PM)

Top
#204673 - 2012-04-09 06:17 PM Re: on some workstations, drive mappings not coming up [Re: Seks]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Originally Posted By: Seks
Not sure why I couldn't post in KiXtart FAQ & How to's???
That forum is not for posting questions.

WRT your script, you are treating the IP octets as string, and then later evaluating them as numeric values. KIX is forgiving in that regard, but is poor coding form.

The failure to map H: cannot be a KIX issue since it isn't part of the script. As for the other drives, are you sure the script is even running? Again, it might not be a KIX issue.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#204674 - 2012-04-09 06:24 PM Re: on some workstations, drive mappings not coming up [Re: ShaneEP]
Seks Offline
Fresh Scripter

Registered: 2002-10-31
Posts: 20
 Originally Posted By: ShaneEP
The script is pretty simple and straight forward. Don't see any problems with it. Have you checked the @error state after the USE commands to see if there is an error being generated? Also, have you tried disabling UAC on the win 7 workstations that are having problems to see if that resolves it?


How do I check this @error state???

The UAC are disabled using group policy. All workstations are part of the domain.

Top
#204675 - 2012-04-09 06:36 PM Re: on some workstations, drive mappings not coming up [Re: Les]
Seks Offline
Fresh Scripter

Registered: 2002-10-31
Posts: 20
 Originally Posted By: Les
 Originally Posted By: Seks
Not sure why I couldn't post in KiXtart FAQ & How to's???
That forum is not for posting questions.

WRT your script, you are treating the IP octets as string, and then later evaluating them as numeric values. KIX is forgiving in that regard, but is poor coding form.


I got those lines from long time ago on this forum board and that was what was recommended. If there is an alternate option, let me know.

 Quote:

The failure to map H: cannot be a KIX issue since it isn't part of the script. As for the other drives, are you sure the script is even running? Again, it might not be a KIX issue.


When I run the script manually in dos prompt on one of the affected workstations

\\srs-edm06\netlogon\kix32 \\srs-edm06\netlogon\srs.kix

One drive would get mapped (maybe) or none at all.

Top
#204676 - 2012-04-09 06:52 PM Re: on some workstations, drive mappings not coming up [Re: Seks]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
 Originally Posted By: Seks
How do I check this @error state???

There are several ways to check the error. You can write it to a log file, or print it to the console, etc...Try the below, which now has a messagebox right after the Use commands. This will also help ensure that the script is running.
 Code:
; Breakdown of IP address------------------------------------------------------------------------

$1st_octet = LTRIM(SUBSTR(@ipaddress0,1,3))
$2nd_octet = LTRIM(SUBSTR(@ipaddress0,5,3))
$3rd_octet = LTRIM(SUBSTR(@ipaddress0,9,3))
$4th_octet = LTRIM(SUBSTR(@ipaddress0,13,3))

;-----------------------------------------------------------------------

USE G: /DELETE /PERSISTENT
USE P: /DELETE /PERSISTENT
USE Q: /DELETE /PERSISTENT
USE R: /DELETE /PERSISTENT
USE X: /DELETE /PERSISTENT
USE Y: /DELETE /PERSISTENT
USE Z: /DELETE /PERSISTENT

USE Z: "\\srs.com\dfs\documents"
$nul = MessageBox("Z: Mapping attempted to srs.com"+@CRLF+"Error: "+@Error+@CRLF+"Desc: "+@SError,"Use Status",0)

SELECT
CASE $3rd_octet = 0
USE P: "\\srs-edm06\public$"
$nul = MessageBox("P: Mapping attempted to srs-edm06"+@CRLF+"Error: "+@Error+@CRLF+"Desc: "+@SError,"Use Status",0)
CASE $3rd_octet = 1
USE P: "\\srs-nisku01\public$"
$nul = MessageBox("P: Mapping attempted to srs-nisku01"+@CRLF+"Error: "+@Error+@CRLF+"Desc: "+@SError,"Use Status",0)
CASE $3rd_octet = 2
USE P: "\\srs-edmfab01\public$"
$nul = MessageBox("P: Mapping attempted to srs-edmfab01"+@CRLF+"Error: "+@Error+@CRLF+"Desc: "+@SError,"Use Status",0)
CASE $3rd_octet = 3
USE P: "\\srs-edmmod01\public$"
$nul = MessageBox("P: Mapping attempted to srs-edmmod01"+@CRLF+"Error: "+@Error+@CRLF+"Desc: "+@SError,"Use Status",0)
ENDSELECT

IF INGROUP("SRS10104 - FTP")
USE X: "\\SRS10104\FTPROOT"
$nul = MessageBox("X: Mapping attempted to SRS10104"+@CRLF+"Error: "+@Error+@CRLF+"Desc: "+@SError,"Use Status",0)
ENDIF

I guess I should note, that this is obviously not recommended for production as it will pop a message box for every mapping attempt.


Edited by ShaneEP (2012-04-09 06:54 PM)

Top
#204677 - 2012-04-09 07:55 PM Re: on some workstations, drive mappings not coming up [Re: Seks]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Originally Posted By: Seks
If there is an alternate option, let me know.

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81917#Post81917
 Code:
$1st = VAL(SUBSTR(@IPAddress0,1,3))
$2nd = VAL(SUBSTR(@IPAddress0,5,3))
$3rd = VAL(SUBSTR(@IPAddress0,9,3))
$4th = VAL(SUBSTR(@IPAddress0,13,3))
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#204682 - 2012-04-10 02:52 PM Re: on some workstations, drive mappings not coming up [Re: Les]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
how about the fact that there might be more than 1 ip-address and the ipaddress0 is in totally different subnet?
_________________________
!

download KiXnet

Top
#204688 - 2012-04-10 06:54 PM Re: on some workstations, drive mappings not coming up [Re: Lonkero]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Yea I'm guessing he realized a problem somewhere since he disappeared.
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 793 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.063 seconds in which 0.028 seconds were spent on a total of 13 queries. Zlib compression enabled.

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