Page 1 of 1 1
Topic Options
#214075 - 2022-04-13 11:40 PM DFS namespace not mapping if the namespace is too long HELP!!
Decker65 Offline
Just in Town

Registered: 2022-04-12
Posts: 3
Loc: North Carolina United States
My company is utilizing Kix scripts in our login scripts to map drives and it has been working fine. We have started to implement DFS namespace and had a strange issue that started when we began to test.

The script that we are using:

 Code:
;Special logic for DFS-n implementation added by Minnie Mouse - April 2022
If exist("\\$NTDataServer\Data01")
   MapDrive("N:", $NTDataServer, "Data01")
   ;MapDrive("N:", $NTDataServer, "Data02")
   MapDrive("R:", domain.net\Global\stuff, "Stuff")
   ;MapDrive("V:", server.ab.domain.com, "Read")
   ;Future usage to delete the H: mapped drive that it's useful for $NTDataServer - But it's NOT a Home Folder
   ;Use H: /Delete /Persistent
   Return
Endif 


the DFS namespace that works: \\Domain.net\AMER\site\Data01

The DFS namespace that does not work:\\Domain.net\AMER\US\site\Data01

all that we did was to move the site from under US and placed it under AMER and things started to work.

The $NTDataServer variable is picked up from the users profile home folder information.

I am no programmer and at the end of my knowledge.


Edited by Mart (2022-04-19 10:55 AM)
Edit Reason: Please use code tags when posting code.

Top
#214087 - 2022-04-14 11:06 PM Re: DFS namespace not mapping if the namespace is too long HELP!! [Re: Decker65]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4372
Loc: New Jersey
MapDrive() is not a built-in function. Can you post which UDF is in your script? This would be something like:
 Code:
Function MapDrive($arg, $arg...)
  commands...
EndFunction
There are a couple of functions in the library with the same name. Most return error results that your code isn't checking for. That would certainly provide more insight into the problem.

Simple/Quick test? Add "@SERROR @CRLF" after each MapDrive() function call to see the error message that's being returned.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#214089 - 2022-04-19 05:05 AM Re: DFS namespace not mapping if the namespace is too long HELP!! [Re: Glenn Barnas]
Decker65 Offline
Just in Town

Registered: 2022-04-12
Posts: 3
Loc: North Carolina United States
Thanks for replying Glen.
I am looking for that as what I posted was a new addition. If you want to see something that Howard did YEARS ago, before my time, here is what he wrote but I do not know how to utilize.

 Code:
; DFS logic by Howard B 8/30/2010
Dim $DFS, $DFSshare_suffices, $path_parts, $DFSshare_suffixes, $DFSdrives, $counter

if instr($Hserver, $Domain) and
	(
	instr($Hserver, "servera")=11
	or instr($Hserver, "serverb")=11
	)
	$path_parts = split($Hserver, "\")
	$bldg=right($path_parts[1],3)

	$NTDataServer = join($path_parts, "\", 2)
	; these two arrays need to match in number of elements (share to drive letter)
;	$DFSshare_suffixes="Apps","Data","Ptemp","EApps","AApps","EData"
;	$DFSdrives="L","N","P","R","T","J"
	$DFSshare_suffixes="Apps","Data","EApps","AApps","EData"
	$DFSdrives="L","N","R","T","J"
	for $counter=0 to ubound($DFSshare_suffixes)
		If exist("\\" +$NTDataServer + "\" + $bldg + $DFSshare_suffixes[$counter])
			MapDrive($DFSdrives[$counter]+":", $NTDataServer, $bldg + $DFSshare_suffixes[$counter])
		Endif
	next
else
	Select
		Case $Hserver="serverfp01"
			$NTDataServer="serverfp00"
			$APPServer="serverfp00"

		Case 1
	  		; Added by H. B 6/19/2009
			if instr($Hserver, "users") > 0
			  $Hserver=Substr($Hserver,1, instr($Hserver, "users")-2)
			Endif

			$NTDataServer=$Hserver
			$APPServer=$Hserver
	EndSelect


Edited by Allen (2022-04-19 06:33 AM)
Edit Reason: code tags

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
1 registered (ShaneEP) and 190 anonymous users online.
Newest Members
SHEBLU_HOSSAIN, JohnShearer, sam_white, Luuraap, mve666
17800 Registered Users

Generated in 0.053 seconds in which 0.024 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