Page 1 of 2 12>
Topic Options
#110820 - 2003-12-24 04:10 PM Network Ressources Mapping with User Auth
Blutgerinsel Offline
Fresh Scripter

Registered: 2003-12-18
Posts: 14
Hello,
I have a Problem with this script only without User Authentifikation it works correctly under administrator account.
I mean there is somewhere a syntax error but where?

Code:

IF instr(@IPADDRESS0,"192") and instr(@IPADDRESS0,"168") and instr(@IPADDRESS0,"5")
IF @userid = 'adm-jack' or @userid = 'jack'
? 'Error '+@ERROR+' - '+@SERROR
USE E: "\\workstat\c$$" /user:adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE F: '\\workstat\d$$' /user:adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE G: '\\workstat\e$$' /user:adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE H: '\\workstat\f$$' /user:adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE I: '\\workstat\g$$' /user:adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE J: '\\workstat\h$$' /user:adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE K: '\\workstat\i$$' /user:adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE L: '\\workstat\l$$' /user:adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE M: '\\workstat\m$$' /user:adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE N: '\\workstat\n$$' /user:adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
ENDIF
Endif


Top
#110821 - 2003-12-24 04:18 PM Re: Network Ressources Mapping with User Auth
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Where does the account live that you are using? Is it local to the workstation or a domain account? You might want to try including the domain. Big security risk though to include your password in the script.

Your use of INSTR() in your IF condition is not a good way to go as you could have false positives.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110822 - 2003-12-24 04:26 PM Re: Network Ressources Mapping with User Auth
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11161
Loc: Boston, MA, USA
See the TCP/IP Primer in the FAQ Forum on how to parse different subnets.

Where does the script run? You cannot authenticate against the same computer with two different accounts unless one cnnection is made to the computername and the second connections is made to the IP address of the computer.
_________________________
There are two types of vessels, submarines and targets.

Top
#110823 - 2003-12-24 05:06 PM Re: Network Ressources Mapping with User Auth
Blutgerinsel Offline
Fresh Scripter

Registered: 2003-12-18
Posts: 14
Quote:

See the TCP/IP Primer in the FAQ Forum on how to parse different subnets.

Where does the script run? You cannot authenticate against the same computer with two different accounts




Why I should go to read FAQ abozut Subnet Masks?
I have only one Subnet Mask in my LAN?

The script runs local on clients and are password protected.
Because I haven*t got any server which is still working...

The Client IPs are static addresses too. The Adresses are get from one DHCP Server. The release time are endless...

The Script shows what IP I get and if the conditions are true. The Client are in my home network. If not the script must not mapping anything of my network drive.

Why I should need subnet about this situation?

The Clients are have the same workgroup, no domain....






Top
#110824 - 2003-12-24 05:09 PM Re: Network Ressources Mapping with User Auth
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11161
Loc: Boston, MA, USA
If you have a workgroup then the user/password must exist on the local computer and you need to prefix the username with the computername.

The TCP/IP Primer shows preferred methods to evaluate whether a specific IPO address is part of a subnet. However, as you have only one subnet, why check this at all?
_________________________
There are two types of vessels, submarines and targets.

Top
#110825 - 2003-12-24 05:28 PM Re: Network Ressources Mapping with User Auth
Blutgerinsel Offline
Fresh Scripter

Registered: 2003-12-18
Posts: 14
Quote:

If you have a workgroup then the user/password must exist on the local computer and you need to prefix the username with the computername.
The TCP/IP Primer shows preferred methods to evaluate whether a specific IPO address is part of a subnet. However, as you have only one subnet, why check this at all?




The user accounts with the password are exist at all workstations exactly.

I check the IP Adress because if I connect to another network at business network for example I don't need this network ressources and need another proxy settings.

That is the reason why I need this condition.

Have I got any errors in my syntax?

Should I take the name of the workgroup anstead the workstation name????

Plz help me thx

Top
#110826 - 2003-12-24 05:31 PM Re: Network Ressources Mapping with User Auth
ShaneEP Moderator Online   content
MM club member
*****

Registered: 2002-11-29
Posts: 2052
Loc: Tulsa, OK
Why do 3 differnt InStr's?

Why not just...

Code:
IF instr(@IPADDRESS0,"192.168.  5")



Instead of...

Code:
IF instr(@IPADDRESS0,"192") and instr(@IPADDRESS0,"168") and instr(@IPADDRESS0,"5")



Or like Jens said...Why check subnet at all if there is only one? Is it possible for someone to run your login script if they are not on your subnet?

Top
#110827 - 2003-12-24 05:35 PM Re: Network Ressources Mapping with User Auth
ShaneEP Moderator Online   content
MM club member
*****

Registered: 2002-11-29
Posts: 2052
Loc: Tulsa, OK
If the adm-jack user is set up locally on all machines then maybe change it from...

Code:
USE E: "\\workstat\c$$" /user:adm-Jack /password:something



To...

Code:
USE E: "\\workstat\c$$" /user:@WkSta\adm-Jack /password:something



As Jens tried pointing out above...


Edited by CitrixMan (2003-12-24 06:21 PM)

Top
#110828 - 2003-12-24 05:40 PM Re: Network Ressources Mapping with User Auth
ShaneEP Moderator Online   content
MM club member
*****

Registered: 2002-11-29
Posts: 2052
Loc: Tulsa, OK
Maybe something like this...

Code:
IF instr(@IPADDRESS0,"192.168.  5")
IF @userid = 'adm-jack' or @userid = 'jack'
USE E: "\\workstat\c$$" /user:@WkSta\adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE F: '\\workstat\d$$' /user:@WkSta\adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE G: '\\workstat\e$$' /user:@WkSta\adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE H: '\\workstat\f$$' /user:@WkSta\adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE I: '\\workstat\g$$' /user:@WkSta\adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE J: '\\workstat\h$$' /user:@WkSta\adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE K: '\\workstat\i$$' /user:@WkSta\adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE L: '\\workstat\l$$' /user:@WkSta\adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE M: '\\workstat\m$$' /user:@WkSta\adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
USE N: '\\workstat\n$$' /user:@WkSta\adm-jack /password:something
? 'Error '+@ERROR+' - '+@SERROR
ENDIF
Endif


Top
#110829 - 2003-12-24 05:47 PM Re: Network Ressources Mapping with User Auth
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

Why I should need subnet about this situation?



Using INSTR() on the IP address without breaking it into octets is not very accurate. The occurance of "5" could happen 48 times (0-254) in any octet and since you preclude only two others, it's more like 96 times! Also the "192" and "168" could occur in any of the four octets! With that sort of inaccuracy, what is the point of even checking?

If this is a workgroup and the scripts are local to every machine, what is the point of checking at all? It certainly is not any kind of security except perhaps security by ignorance.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110830 - 2003-12-24 05:47 PM Re: Network Ressources Mapping with User Auth
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11161
Loc: Boston, MA, USA
Which i already pointed out, too:
Quote:

If you have a workgroup then the user/password must exist on the local computer and you need to prefix the username with the computername



However, silver-platter-code might illustrate it as well.
_________________________
There are two types of vessels, submarines and targets.

Top
#110831 - 2003-12-24 06:19 PM Re: Network Ressources Mapping with User Auth
ShaneEP Moderator Online   content
MM club member
*****

Registered: 2002-11-29
Posts: 2052
Loc: Tulsa, OK
Hey the boards been slow...I was bored. Besides...If he realizes all of this information can be found in the FAQs and Manuals then he may never post again...And then what would we do around here...

Edited by CitrixMan (2003-12-24 06:23 PM)

Top
#110832 - 2003-12-24 07:33 PM Re: Network Ressources Mapping with User Auth
Blutgerinsel Offline
Fresh Scripter

Registered: 2003-12-18
Posts: 14
Really that this resolution works?

Quote:


USE E: "\\workstat\c$$" /user:@WkSta\adm-Jack /password:something




Unknown username or wrong password have I recieved........

Top
#110833 - 2003-12-24 09:17 PM Re: Network Ressources Mapping with User Auth
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Have not tried but this looks better to me since the workstaion is not an NT domain name.

USE E: "\\workstat\c$$" /user:\\@WkSta\adm-Jack /password:something
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#110834 - 2003-12-24 09:20 PM Re: Network Ressources Mapping with User Auth
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
THis all seems odd to me... logon scripts without a domain. I think the computer name of the computer where the resource is should be on the line, not @WKSTA. Also, if these are admin shares, don't they need to be local admins to use them?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110835 - 2003-12-24 09:37 PM Re: Network Ressources Mapping with User Auth
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Also, there is a hyphen in the username. I bet KiX is trying to do math on it. Who in their right mind would put hyphens in a username?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110836 - 2003-12-24 09:49 PM Re: Network Ressources Mapping with User Auth
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11548
Loc: CA
Perhaps try something like this

Code:
 USE E: "\\workstat\c$$" /user:@WkSta+"\adm-Jack" /password:something   


Top
#110837 - 2003-12-24 09:52 PM Re: Network Ressources Mapping with User Auth
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11548
Loc: CA
Could also possibly use something like this if you use the NoVarInStrings option.


Debug Off
Break On
Dim $iRC
$iRC=SetOption('Explicit','On')
$iRC=SetOption('NoVarsInStrings','On')

USE E: "\\workstat\c$" /user:"system where account resides" + "\" +"adm-Jack" /password:something
? 'Mapping success: ' + @ERROR + ' '+@SERROR

Top
#110838 - 2003-12-24 10:57 PM Re: Network Ressources Mapping with User Auth
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
HEHEE
DOC and I were chatting about this on MSN, while DOC was testing some code against one of his servers. A server, I might add that has hyphens in the name. The test code kept returning syntax errors until he wrapped the server name it in quotes. KiX has historically had problems parsing some parms with hyphens and the like so one needs to consider this both when naming objects and later when coding around these objects.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110839 - 2003-12-25 01:03 AM Re: Network Ressources Mapping with User Auth
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11161
Loc: Boston, MA, USA
Also, you need to supply the username/password of the account that is on the same computer as the share, thus
Code:

$comp='workstation'
$user='username'
$pass='wassword'
use u: '\\'+$comp+'\c$$' /user:+$comp+'\'+$user /pass:$password

_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
3 registered (Jochen, Shawn, Mart) and 220 anonymous users online.
Newest Members
nremmel, AlexTheGreat, ovdmtz, AlexPallaress, wschenk
17490 Registered Users

Generated in 0.048 seconds in which 0.012 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