Avatar of TechEli
TechEliFlag for Spain

asked on 

Login script Windows 2003 KIX32

Good morning,
I need to create a script with the following characteristics:
Two people in particular and if they connect only to a specific machine

I tried the following, but it gives me error:

IF @USERID = 'Fores' OR @USERID = 'Tom' AND (@WKSTA,4)="W209"
    USE Z: "\\srvapp\app"
EndIf
Windows BatchMicrosoft DOSWindows Server 2003Shell Scripting

Avatar of undefined
Last Comment
MarkieS
Avatar of ronnypot
ronnypot
Flag of Netherlands image

Hi,

And if you try this:
IF @WKSTA="W209"
  IF @USERID = 'Fores' OR @USERID = 'Tom'
    USE Z: "\\srvapp\app"
  ENDIF
ENDIF
ASKER CERTIFIED SOLUTION
Avatar of MarkieS
MarkieS
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of TechEli
TechEli
Flag of Spain image

ASKER

I tested this script:

 IF ((@ USERID = "Fores" OR @ USERID = "Tom") AND @ WKSTA = "W209") = TRUE
       USE Z: \ \ srvapp \ app "/ PERSISTENT
 EndIf

 It works, but does not respect the machine. Connect to any machine and I mapped the drive
Avatar of TechEli
TechEli
Flag of Spain image

ASKER

Hi, Tnx MikieS,

The correct script:

 IF ((@ USERID = "Fores" OR @ USERID = "Tom") AND @ WKSTA = "W209") = 1
       USE Z: \ \ srvapp \ app "/ PERSISTENT
 EndIf
Avatar of TechEli
TechEli
Flag of Spain image

ASKER

Tnx
Avatar of MarkieS
MarkieS
Flag of United Kingdom of Great Britain and Northern Ireland image

Very welcome!

(Sorry, my scripts all contain variables TRUE=1 FALSE=0 at the beginning!  I missed it out!)
Windows Server 2003
Windows Server 2003

Windows Server 2003 was based on Windows XP and was released in four editions: Web, Standard, Enterprise and Datacenter. It also had derivative versions for clusters, storage and Microsoft’s Small Business Server. Important upgrades included integrating Internet Information Services (IIS), improvements to Active Directory (AD) and Group Policy (GP), and the migration to Automated System Recovery (ASR).

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo