Page 1 of 2 12>
Topic Options
#183349 - 2007-12-06 04:25 PM share mapping with script - strange results
mikeemikee Offline
Fresh Scripter

Registered: 2007-06-12
Posts: 23
Loc: Germany, Hildesheim
Hello!

my problem is following. I use a script to map network shares. that script
 Code:
$sShareIni= @SCRIPTDIR + "\netmap_DH.ini"


If ReadProfileString($sShareIni,"","")
	If $bDEBUG
		"DEBUG: Die folgenden Sektionen erscheinen in der INI.-Datei:" ?
		"-----------------------------------------------------" ?
		ReadProfileString($sShareIni,"","")
		"-----------------------------------------------------" ?
	EndIf
Else
	If Exist($sShareIni)
		"ERROR: INI-Datei '"+$sShareIni+"' ist leer oder ungültig!" ?
	Else
		"ERROR: INI-Datei '"+$sShareIni+"' existiert nicht!" ?
	EndIf
	Exit 1
EndIf

USE LIST @CRLF
USE * /DELETE @CRLF

$bDEBUG=1
$username=@WUSERID
$iIndex=0
$sGroup=EnumGroup($iIndex)

;While $sGroup AND Not @FEHLER
DO

	If InStr($sGroup,"\") $sGroup=SubStr($sGroup,InStr($sGroup,"\")+1)
	EndIf

	If $bDEBUG Color w+/b "DEBUG: Suche nach Sektion [LOCATION "+$sGroup+"]" Color w/n ? 
	EndIf

	For Each $sShare in Split(ReadProfileString($sShareIni,"LOCATION "+$sGroup,""),Chr(10))

		If $sShare

			$asSharePair=Split(ReadProfileString($sShareIni,"LOCATION "+$sGroup,$sShare),"|")			
			DIM $Befehl1
			$Befehl1 = $asSharePair[0]+$asSharePair[1]
			"Mappe Netzwerkpfad "+$asSharePair[1]+" auf "+$asSharePair[0] @CRLF
			
			Execute( 'USE $Befehl1' )
			If @ERROR=0
				? "1. Statement" @CRLF
				"  " Color g+/n "OK" Color w/n @CRLF				
				? "Fehlercode " + "im " + $sShare + " : " +@Error @CRLF
			Else
				? "Else-Statement" @CRLF
			
				"  " Color r+/n "*Fehlgeschlagen*" Color w/n @CRLF
				? "Fehlercode " + "im " + $sShare + " : " +@Error @CRLF
			EndIf
		EndIf
	Next

	$iIndex = $iIndex + 1
	$sGroup = EnumGroup($iIndex)


;Loop
UNTIL Len($sGroup) = 0

USE B: "\\fs01\home$\$username"
	IF @ERROR=0
		? "B ist angehaengt" +@Error
		? "Fehlercode: " +@Error
	Else
		? "Fehler" +@Error
		? "Fehlercode: " +@Error
	EndIf

USE LIST @CRLF


Exit 0
 

uses a in-File (excerpt of it)
 Code:

[LOCATION [LOCATION EDV_map]
it=I:| "\\network.local\dfs01\it"

.

Output:
 Code:
[color:#FF0000]DEBUG: Suche nach Sektion [LOCATION EDV_map]
Mappe Netzwerkpfad  "\\network.local\dfs01\it" auf Y:
0
1. Statement
  OK

Fehlercode im it : 0[/color]
DEBUG: Suche nach Sektion [LOCATION Ctx-Admin-Tools]
DEBUG: Suche nach Sektion [LOCATION EDV_print]
[color:#FF0000]DEBUG: Suche nach Sektion [LOCATION EDV_map]
Mappe Netzwerkpfad  "\\network.local\dfs01\it" auf Y:
0
1. Statement
  OK

Fehlercode im it : 0[/color]
DEBUG: Suche nach Sektion [LOCATION SAP-Gruppe-REWE]


The script runs two times in the section "it". I do not know, why it does.
Does anyone of you know why?

Regards
Stefan


Edited by mikeemikee (2007-12-06 04:25 PM)

Top
#183352 - 2007-12-06 05:19 PM Re: share mapping with script - strange results [Re: mikeemikee]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
[LOCATION [LOCATION EDV_map]

In your Ini snipet, You have mismatched brackets. Is this a typo?

Top
#183364 - 2007-12-07 09:09 AM Re: share mapping with script - strange results [Re: Allen]
mikeemikee Offline
Fresh Scripter

Registered: 2007-06-12
Posts: 23
Loc: Germany, Hildesheim
Oh, that is an mistake in writing the post.

[LOCATION EDV_map] is the entry in the ini-file.

Top
#183374 - 2007-12-07 02:03 PM Re: share mapping with script - strange results [Re: mikeemikee]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Why do you have @CRLF after the USE commands?
 Quote:
USE LIST @CRLF
USE * /DELETE @CRLF
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#183375 - 2007-12-07 02:24 PM Re: share mapping with script - strange results [Re: Howard Bullock]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I noticed that when I test the ENUMGROUP loop I do get an execution of the loop when the group seems to be empty.

Add a line to output the group name just after "If $sShare"

? "Debug group name + share: " + $sGroup + " ~ " + $sShare

What are the results when you see the double execution?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#183376 - 2007-12-07 02:36 PM Re: share mapping with script - strange results [Re: Howard Bullock]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
Hi mikeemikee,

lets try a little different approch, run this:
 Code:
$objRootDSE = GetObject("LDAP://rootDSE")
$defaultNamingContext = $objRootDSE.Get("defaultNamingContext")

$sShareIni= @SCRIPTDIR + "\netmap_DH.ini"

If ReadProfileString($sShareIni,"","")
	If $bDEBUG
		"DEBUG: Die folgenden Sektionen erscheinen in der INI.-Datei:" ?
		"-----------------------------------------------------" ?
		ReadProfileString($sShareIni,"","")
		"-----------------------------------------------------" ?
	EndIf
Else
	If Exist($sShareIni)
		"ERROR: INI-Datei '"+$sShareIni+"' ist leer oder ungültig!" ?
	Else
		"ERROR: INI-Datei '"+$sShareIni+"' existiert nicht!" ?
	EndIf
	Exit 1
EndIf

Use LIST @CRLF
Use * /DELETE @CRLF

$bDEBUG=1
$username=@WUSERID

$MemberOfArray = Split(MemberOfArray(),',')

;While $sGroup AND Not @FEHLER
;Do
For Each $sGroup in $MemberOfArray

	If InStr($sGroup,"\") $sGroup=SubStr($sGroup,InStr($sGroup,"\")+1)
	EndIf

	If $bDEBUG Color w+/b "DEBUG: Suche nach Sektion [LOCATION "+$sGroup+"]" Color w/n ? 
	EndIf

	For Each $sShare in Split(ReadProfileString($sShareIni,"LOCATION "+$sGroup,""),Chr(10))

		If $sShare

			$asSharePair=Split(ReadProfileString($sShareIni,"LOCATION "+$sGroup,$sShare),"|")			
			Dim $Befehl1
			$Befehl1 = $asSharePair[0]+$asSharePair[1]
			"Mappe Netzwerkpfad "+$asSharePair[1]+" auf "+$asSharePair[0] @CRLF
			
			Execute( 'USE $Befehl1' )
			If @ERROR=0
				? "1. Statement" @CRLF
				"  " Color g+/n "OK" Color w/n @CRLF				
				? "Fehlercode " + "im " + $sShare + " : " +@Error @CRLF
			Else
				? "Else-Statement" @CRLF
			
				"  " Color r+/n "*Fehlgeschlagen*" Color w/n @CRLF
				? "Fehlercode " + "im " + $sShare + " : " +@Error @CRLF
			EndIf
		EndIf
	Next

;	$iIndex = $iIndex + 1
;	$sGroup = EnumGroup($iIndex)

;Loop
;Until Len($sGroup) = 0
Next

Use B: "\\fs01\home$\$username"
	If @ERROR=0
		? "B ist angehaengt" +@Error
		? "Fehlercode: " +@Error
	Else
		? "Fehler" +@Error
		? "Fehlercode: " +@Error
	EndIf

Use LIST @CRLF

Exit 0

Function MemberOfArray()
	$E_ADS_PROPERTY_NOT_FOUND = &8000500D
  $ObjUser = GetObject ("LDAP://" + GetUserDistinguishedName(@FULLNAME))
  $IntPrimaryGroupID = $ObjUser.Get("PrimaryGroupID")
	$ArrMemberOf = $ObjUser.GetEX("MemberOf")
	If $ERR.Number = $E_ADS_PROPERTY_NOT_FOUND
		$= MessageBox("The MemberOf Attribute Is Not Set.","Error!",16)
		Exit
	Else
		For Each $Group in $ArrMemberOf
			$x = InStr($Group,",")
			$GroupName = SubStr($Group,4,$x - 4)
			$MemberOfArray = $MemberOfArray+','+$GroupName
			$Index = $Index + 1
		Next
	EndIf
EndFunction

Function GetUserDistinguishedName($FullName)
	
  $ADS_UF_ACCOUNTDISABLE = 2
	
	$ObjConnectION = CreateObject("ADODB.ConnectION")
	$ObjConnectION.Open("PROVIDER=ADSDSOOBJECT;")
	$ObjCOMMAND = CreateObject("ADODB.COMMAND")
	$ObjCOMMAND.ActiveConnectION = $ObjConnectION
	$ObjCOMMAND.COMMANDTEXT = "<GC://" + $defaultNamingContext + ">;(OBJECTCATEGORY=User);UserACCOUNTCONTROL,DistinguishedName;SUBTREE"
  $ObjRecordset = $ObjCOMMAND.Execute
	While Not $ObjRecordset.EOF
		$POSITIVE = InStr($ObjRecordset.Fields("DistinguishedName"),"CN=" + $FullName)
		If $POSITIVE <> 0
			$ObjUser = GetObject("LDAP://" + $ObjRecordset.Fields("DistinguishedName"))
			$ObjUser.GetInfo
			$GetUserDistinguishedName = $ObjUser.Get("DistinguishedName")
		EndIf
		$ObjRecordset.MoveNext
	Loop
	$ObjConnectION.Close
	
EndFunction



Edited by Benny69 (2007-12-07 02:41 PM)
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#183377 - 2007-12-07 02:39 PM Re: share mapping with script - strange results [Re: Howard Bullock]
mikeemikee Offline
Fresh Scripter

Registered: 2007-06-12
Posts: 23
Loc: Germany, Hildesheim
 Originally Posted By: Howard Bullock
Why do you have @CRLF after the USE commands?
 Quote:
USE LIST @CRLF
USE * /DELETE @CRLF



I used it, in order to set a new line after the "use list" output.

Top
#183378 - 2007-12-07 02:42 PM Re: share mapping with script - strange results [Re: mikeemikee]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
Ooopppsss i missed something in there I have updated my previous post to reflect the change, try it now
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#183379 - 2007-12-07 02:42 PM Re: share mapping with script - strange results [Re: Howard Bullock]
mikeemikee Offline
Fresh Scripter

Registered: 2007-06-12
Posts: 23
Loc: Germany, Hildesheim
 Originally Posted By: Howard Bullock
I noticed that when I test the ENUMGROUP loop I do get an execution of the loop when the group seems to be empty.

Add a line to output the group name just after "If $sShare"

? "Debug group name + share: " + $sGroup + " ~ " + $sShare

What are the results when you see the double execution?


After the line of code, the results are the follwing:

C:\>\\hildesheim\netlogon\kix32 \\hildesheim\netlogon\addnet_DH.kix /f

Current redirections :

Y: --> \\hildesheim\dfs01\it
B: --> \\fs01\home$\dhssen

HILDESHEIM\Domänen-Benutzer
Jeder
DH-PC-IT-08\Administratoren
DH-PC-IT-08\Benutzer
INTERAKTIV
Authentifizierte Benutzer
Diese Organisation
LOKAL
HILDESHEIM\DV-Postfach
HILDESHEIM\LKH_Info_map
Debug group name + share: LKH_Info_map ~ lkhinfo
Mappe Netzwerkpfad "\\hildesheim\dfs01\LKHInformation" auf X:
0
1. Statement
OK

Fehlercode im lkhinfo : 0

HILDESHEIM\FB-I-SD-BrunieText
HILDESHEIM\VW-DV-Organisation-DV-Webadmin
HILDESHEIM\VW-ZugriffEtagendruckerG1
HILDESHEIM\Ctx-Zugriff-Corel
HILDESHEIM\EDV-Daten
HILDESHEIM\EDV
HILDESHEIM\DH-SIGMA
HILDESHEIM\VW-DV-Organisation
HILDESHEIM\VW-Alle
HILDESHEIM\Zugriff-Apotheken-Programm
HOLSTEIN\Sigma_Universal
HOLSTEIN\Sigma_DH
HILDESHEIM\LKH_Info_map
Debug group name + share: LKH_Info_map ~ lkhinfo
Mappe Netzwerkpfad "\\hildesheim\dfs01\LKHInformation" auf X:
0
1. Statement
OK

Fehlercode im lkhinfo : 0

HILDESHEIM\Ctx-Zugriff-Corel
HILDESHEIM\VW-DV-Organisation-DV-Webadmin
HILDESHEIM\EDV
HILDESHEIM\Zugriff-Apotheken-Programm
HILDESHEIM\VW-Alle
HILDESHEIM\DHSSEN
HILDESHEIM\FB-I-SD-BrunieText
HILDESHEIM\DV-Postfach
HILDESHEIM\VW-ZugriffEtagendruckerG1
HILDESHEIM\VW-DV-Organisation
HILDESHEIM\Zugriff-SAP-Testsystem
HILDESHEIM\SAP-Gruppe-REWE
HILDESHEIM\Verw_print
HILDESHEIM\Zugriff-Plotter
HILDESHEIM\Ctx-cmd
HILDESHEIM\EDV_map
Debug group name + share: EDV_map ~ it
Mappe Netzwerkpfad "\\hildesheim\dfs01\it" auf Y:
0
1. Statement
OK

Fehlercode im it : 0

HILDESHEIM\Ctx-Admin-Tools
HILDESHEIM\EDV_print
HILDESHEIM\EDV_map
Debug group name + share: EDV_map ~ it
Mappe Netzwerkpfad "\\hildesheim\dfs01\it" auf Y:
0
1. Statement
OK

Fehlercode im it : 0

HILDESHEIM\SAP-Gruppe-REWE
HILDESHEIM\Zugriff-SAP-Testsystem
HILDESHEIM\Ctx-cmd
HILDESHEIM\Ctx-Admin-Tools
HILDESHEIM\EDV_print
HILDESHEIM\Zugriff-Plotter
HILDESHEIM\Verw_print
Verbindliche Beschriftung\Mittlere Verbindlichkeitsstufe
Benutzer
B ist angehaengt0
Fehlercode: 0
Current redirections :

Y: --> \\hildesheim\dfs01\it
B: --> \\fs01\home$\dhssen

Top
#183382 - 2007-12-07 02:58 PM Re: share mapping with script - strange results [Re: Benny69]
mikeemikee Offline
Fresh Scripter

Registered: 2007-06-12
Posts: 23
Loc: Germany, Hildesheim
 Originally Posted By: Benny69
Hi mikeemikee,

lets try a little different approch, run this:
 Code:
$objRootDSE = GetObject("LDAP://rootDSE")
$defaultNamingContext = $objRootDSE.Get("defaultNamingContext")

$sShareIni= @SCRIPTDIR + "\netmap_DH.ini"

If ReadProfileString($sShareIni,"","")
	If $bDEBUG
		"DEBUG: Die folgenden Sektionen erscheinen in der INI.-Datei:" ?
		"-----------------------------------------------------" ?
		ReadProfileString($sShareIni,"","")
		"-----------------------------------------------------" ?
	EndIf
Else
	If Exist($sShareIni)
		"ERROR: INI-Datei '"+$sShareIni+"' ist leer oder ungültig!" ?
	Else
		"ERROR: INI-Datei '"+$sShareIni+"' existiert nicht!" ?
	EndIf
	Exit 1
EndIf

Use LIST @CRLF
Use * /DELETE @CRLF

$bDEBUG=1
$username=@WUSERID

$MemberOfArray = Split(MemberOfArray(),',')

;While $sGroup AND Not @FEHLER
;Do
For Each $sGroup in $MemberOfArray

	If InStr($sGroup,"\") $sGroup=SubStr($sGroup,InStr($sGroup,"\")+1)
	EndIf

	If $bDEBUG Color w+/b "DEBUG: Suche nach Sektion [LOCATION "+$sGroup+"]" Color w/n ? 
	EndIf

	For Each $sShare in Split(ReadProfileString($sShareIni,"LOCATION "+$sGroup,""),Chr(10))

		If $sShare

			$asSharePair=Split(ReadProfileString($sShareIni,"LOCATION "+$sGroup,$sShare),"|")			
			Dim $Befehl1
			$Befehl1 = $asSharePair[0]+$asSharePair[1]
			"Mappe Netzwerkpfad "+$asSharePair[1]+" auf "+$asSharePair[0] @CRLF
			
			Execute( 'USE $Befehl1' )
			If @ERROR=0
				? "1. Statement" @CRLF
				"  " Color g+/n "OK" Color w/n @CRLF				
				? "Fehlercode " + "im " + $sShare + " : " +@Error @CRLF
			Else
				? "Else-Statement" @CRLF
			
				"  " Color r+/n "*Fehlgeschlagen*" Color w/n @CRLF
				? "Fehlercode " + "im " + $sShare + " : " +@Error @CRLF
			EndIf
		EndIf
	Next

;	$iIndex = $iIndex + 1
;	$sGroup = EnumGroup($iIndex)

;Loop
;Until Len($sGroup) = 0
Next

Use B: "\\fs01\home$\$username"
	If @ERROR=0
		? "B ist angehaengt" +@Error
		? "Fehlercode: " +@Error
	Else
		? "Fehler" +@Error
		? "Fehlercode: " +@Error
	EndIf

Use LIST @CRLF

Exit 0

Function MemberOfArray()
	$E_ADS_PROPERTY_NOT_FOUND = &8000500D
  $ObjUser = GetObject ("LDAP://" + GetUserDistinguishedName(@FULLNAME))
  $IntPrimaryGroupID = $ObjUser.Get("PrimaryGroupID")
	$ArrMemberOf = $ObjUser.GetEX("MemberOf")
	If $ERR.Number = $E_ADS_PROPERTY_NOT_FOUND
		$= MessageBox("The MemberOf Attribute Is Not Set.","Error!",16)
		Exit
	Else
		For Each $Group in $ArrMemberOf
			$x = InStr($Group,",")
			$GroupName = SubStr($Group,4,$x - 4)
			$MemberOfArray = $MemberOfArray+','+$GroupName
			$Index = $Index + 1
		Next
	EndIf
EndFunction

Function GetUserDistinguishedName($FullName)
	
  $ADS_UF_ACCOUNTDISABLE = 2
	
	$ObjConnectION = CreateObject("ADODB.ConnectION")
	$ObjConnectION.Open("PROVIDER=ADSDSOOBJECT;")
	$ObjCOMMAND = CreateObject("ADODB.COMMAND")
	$ObjCOMMAND.ActiveConnectION = $ObjConnectION
	$ObjCOMMAND.COMMANDTEXT = "<GC://" + $defaultNamingContext + ">;(OBJECTCATEGORY=User);UserACCOUNTCONTROL,DistinguishedName;SUBTREE"
  $ObjRecordset = $ObjCOMMAND.Execute
	While Not $ObjRecordset.EOF
		$POSITIVE = InStr($ObjRecordset.Fields("DistinguishedName"),"CN=" + $FullName)
		If $POSITIVE <> 0
			$ObjUser = GetObject("LDAP://" + $ObjRecordset.Fields("DistinguishedName"))
			$ObjUser.GetInfo
			$GetUserDistinguishedName = $ObjUser.Get("DistinguishedName")
		EndIf
		$ObjRecordset.MoveNext
	Loop
	$ObjConnectION.Close
	
EndFunction




hm, I get this error:


ERROR : undefined variable [objRootDSE]!
Script: \\hildesheim\netlogon\test.kix
Line : 14

Top
#183383 - 2007-12-07 03:02 PM Re: share mapping with script - strange results [Re: Benny69]
mikeemikee Offline
Fresh Scripter

Registered: 2007-06-12
Posts: 23
Loc: Germany, Hildesheim
Hi Benny,

that`s is the output:


C:\>\\hildesheim\netlogon\kix32 \\hildesheim\netlogon\test.kix /f

Current redirections :

B: --> \\fs01\home$\dhssen


PrimaryGroupIDMemberOfDEBUG: Suche nach Sektion [LOCATION ]

B ist angehaengt0
Fehlercode: 0
Current redirections :

B: --> \\fs01\home$\dhssen

Top
#183384 - 2007-12-07 03:05 PM Re: share mapping with script - strange results [Re: mikeemikee]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
are you doing somthing like:

 Code:
$SO=SetOption("Explicit", "ON")


if you are rem it for testing the code i provided:
 Code:
;$SO=SetOption("Explicit", "ON")
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#183385 - 2007-12-07 03:06 PM Re: share mapping with script - strange results [Re: Benny69]
mikeemikee Offline
Fresh Scripter

Registered: 2007-06-12
Posts: 23
Loc: Germany, Hildesheim
 Originally Posted By: Benny69
are you doing somthing like:

 Code:
$SO=SetOption("Explicit", "ON")


if you are rem it for testing the code i provided:
 Code:
;$SO=SetOption("Explicit", "ON")



That is not defined.

Top
#183386 - 2007-12-07 03:07 PM Re: share mapping with script - strange results [Re: Benny69]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
i am sorry i don't know German, if you could translate it would help, and does it look like it is only running thru once like you want?
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#183387 - 2007-12-07 03:17 PM Re: share mapping with script - strange results [Re: mikeemikee]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA


The output shows that the same value for $sGroup is processed twice. However we did not include the Index value to see if it had change.

 Quote:
Debug group name + share: LKH_Info_map ~ lkhinfo
followed by
Debug group name + share: LKH_Info_map ~ lkhinfo


Please run the following code and post the results. It will just display the groups that ENUMGROUP lists along with a counter. I am trying to determine why the group value is not different the second time thorugh the loop.

 Code:
$Index = 0
$x=0
DO
  $x = 1 + $x
  ? $x
  $Group = ENUMGROUP($Index)
   " " + $Index + ":" + $Group
  $Index=$Index+1
UNTIL Len($Group) = 0 
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#183388 - 2007-12-07 03:18 PM Re: share mapping with script - strange results [Re: Benny69]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
wait, are you using Active Directory, if not i need to re-work the code i provided.
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#183389 - 2007-12-07 03:18 PM Re: share mapping with script - strange results [Re: Benny69]
mikeemikee Offline
Fresh Scripter

Registered: 2007-06-12
Posts: 23
Loc: Germany, Hildesheim
 Originally Posted By: Benny69
i am sorry i don't know German, if you could translate it would help, and does it look like it is only running thru once like you want?


Hi benny,

sorry for the german passages, i have translated the into english.

C:\>\\hildesheim\netlogon\kix32 \\hildesheim\netlogon\test.kix /f

Current redirections :

No entries in list.


PrimaryGroupIDMemberOfDEBUG: Locating section [LOCATION ]

Error55
Errorcode: 55
Current redirections :

No entries in list.


---

It seems that it loops in the MemberOfArray() function without results.

Top
#183390 - 2007-12-07 03:20 PM Re: share mapping with script - strange results [Re: Benny69]
mikeemikee Offline
Fresh Scripter

Registered: 2007-06-12
Posts: 23
Loc: Germany, Hildesheim
 Originally Posted By: Benny69
wait, are you using Active Directory, if not i need to re-work the code i provided.


Yes, there is active directory present. (window s2003)

Top
#183391 - 2007-12-07 03:21 PM Re: share mapping with script - strange results [Re: Howard Bullock]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Logically your FOR loop is the problem

 Code:
	For Each $sShare in Split(ReadProfileString($sShareIni,"LOCATION "+$sGroup,""),Chr(10)) 


It seems to be looping two times when you expect on one iteration.

Can you post more of your INI file for testing?


Edited by Howard Bullock (2007-12-07 03:23 PM)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#183392 - 2007-12-07 03:24 PM Re: share mapping with script - strange results [Re: Howard Bullock]
mikeemikee Offline
Fresh Scripter

Registered: 2007-06-12
Posts: 23
Loc: Germany, Hildesheim
 Originally Posted By: Howard Bullock


The output shows that the same value for $sGroup is processed twice. However we did not include the Index value to see if it had change.

 Quote:
Debug group name + share: LKH_Info_map ~ lkhinfo
followed by
Debug group name + share: LKH_Info_map ~ lkhinfo


Please run the following code and post the results. It will just display the groups that ENUMGROUP lists along with a counter. I am trying to determine why the group value is not different the second time thorugh the loop.

 Code:
$Index = 0
$x=0
DO
  $x = 1 + $x
  ? $x
  $Group = ENUMGROUP($Index)
   " " + $Index + ":" + $Group
  $Index=$Index+1
UNTIL Len($Group) = 0 



Hi Howard,

that is the output of your code:

1 :HILDESHEIM\Domänen-Benutzer
2 1:Jeder
3 2:DH-PC-IT-08\Administratoren
4 3:DH-PC-IT-08\Benutzer
5 4:INTERAKTIV
6 5:Authentifizierte Benutzer
7 6:Diese Organisation
8 7:LOKAL
9 8:HILDESHEIM\DV-Postfach
10 9:HILDESHEIM\LKH_Info_map
11 10:HILDESHEIM\FB-I-SD-BrunieText
12 11:HILDESHEIM\VW-DV-Organisation-DV-Webadmin
13 12:HILDESHEIM\VW-ZugriffEtagendruckerG1
14 13:HILDESHEIM\Ctx-Zugriff-Corel
15 14:HILDESHEIM\EDV-Daten
16 15:HILDESHEIM\EDV
17 16:HILDESHEIM\DH-SIGMA
18 17:HILDESHEIM\VW-DV-Organisation
19 18:HILDESHEIM\VW-Alle
20 19:HILDESHEIM\Zugriff-Apotheken-Programm
21 20:HOLSTEIN\Sigma_Universal
22 21:HOLSTEIN\Sigma_DH
23 22:HILDESHEIM\LKH_Info_map
24 23:HILDESHEIM\Ctx-Zugriff-Corel
25 24:HILDESHEIM\VW-DV-Organisation-DV-Webadmin
26 25:HILDESHEIM\EDV
27 26:HILDESHEIM\Zugriff-Apotheken-Programm
28 27:HILDESHEIM\VW-Alle
29 28:HILDESHEIM\DHSSEN
30 29:HILDESHEIM\FB-I-SD-BrunieText
31 30:HILDESHEIM\DV-Postfach
32 31:HILDESHEIM\VW-ZugriffEtagendruckerG1
33 32:HILDESHEIM\VW-DV-Organisation
34 33:HILDESHEIM\Zugriff-SAP-Testsystem
35 34:HILDESHEIM\SAP-Gruppe-REWE
36 35:HILDESHEIM\Verw_print
37 36:HILDESHEIM\Zugriff-Plotter
38 37:HILDESHEIM\Ctx-cmd
39 38:HILDESHEIM\EDV_map
40 39:HILDESHEIM\Ctx-Admin-Tools
41 40:HILDESHEIM\EDV_print
42 41:HILDESHEIM\EDV_map
43 42:HILDESHEIM\SAP-Gruppe-REWE
44 43:HILDESHEIM\Zugriff-SAP-Testsystem
45 44:HILDESHEIM\Ctx-cmd
46 45:HILDESHEIM\Ctx-Admin-Tools
47 46:HILDESHEIM\EDV_print
48 47:HILDESHEIM\Zugriff-Plotter
49 48:HILDESHEIM\Verw_print
50 49:Verbindliche Beschriftung\Mittlere Verbindlichkeitsstufe
51 50:Benutzer
52 51:


And you are right, there are double entries for EDV_map. hmm...

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 366 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.153 seconds in which 0.105 seconds were spent on a total of 14 queries. Zlib compression enabled.

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