#110820 - 2003-12-24 04:10 PM
Network Ressources Mapping with User Auth
|
Blutgerinsel
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
|
|
|
|
#110823 - 2003-12-24 05:06 PM
Re: Network Ressources Mapping with User Auth
|
Blutgerinsel
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
|
|
|
|
#110825 - 2003-12-24 05:28 PM
Re: Network Ressources Mapping with User Auth
|
Blutgerinsel
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
MM club member
Registered: 2002-11-29
Posts: 2125
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
MM club member
Registered: 2002-11-29
Posts: 2125
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
MM club member
Registered: 2002-11-29
Posts: 2125
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
|
|
|
|
#110832 - 2003-12-24 07:33 PM
Re: Network Ressources Mapping with User Auth
|
Blutgerinsel
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
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
|
Top
|
|
|
|
#110836 - 2003-12-24 09:49 PM
Re: Network Ressources Mapping with User Auth
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
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
Registered: 2000-07-28
Posts: 11624
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 980 anonymous users online.
|
|
|