[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 9779
  • Last Modified:

NET USE in login script Windows server 2003

I'm trying to troubleshoot problems with login script windows server 2003.  Script is as follows:

REM Login Script PL Jacques Dec 1, 2004
echo on

net use F: /DELETE
net use F: \\IHR_SERVER\FRS

ifmember fd_grp
if errorlevel 1 goto fd_grp

ifmember sales_grp
if errorlevel 1 goto sales_grp

ifmember acct_grp
if errorlevel 1 goto acct_grp

goto end

net use lpt1 /delete
net use lpt2 /delete
net use lpt1: \\nightaudit\fdlaser
goto end

net use lpt1 /delete
net use lpt2 /delete
net use lpt1: \\conferencesvc\reslaser
net use lpt2: \\nightaudit\fdlaser
goto end

net use lpt1 /delete
net use lpt2 /delete
net use lpt1: \\acct\acctlaser
net use lpt2: \\nightaudit\fdlaser
goto end


We're running a DOS app that only prints to LPT1 or LPT2 so I have to do net use command to redirect printing in different departments.  I have two problems.  First I'm getting an error about IFMEMBER not being recognized as and internal or external command.  I downloaded the Server 2003 resource kit and installed it on the server 2003 machine.  Is there more?

Secondly the net use command map drives works OK.  But, when I try to do net use to redirect some the shared printer on one of the computers, it asks me to authenticate to that computer.  Let me reiterate, it asks me to authenticate to the computer not to the domain.  No matter what I enter, it does not work.  If I log out and log back in as Administrator with local and domain administrative rights it works.  What rights are required for this to work?
1 Solution
For the ifmember.exe to work, you'll have to copy it from the installation folder into the netlogon share; it should work then (assuming this is a "profile" logon script).
As for the "net use lpt" problem, I'm assuming you're using XP clients? Then you're fighting against XP's tightened security; by default, users can't map over an existing hardware port:
Non-Administrators Cannot Remap an LPT Port to a Network Printer

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now