Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

Simple question about 'ifmember'

I have a small part of my login script that uses ifmember to control acces to a mapped network drive via membership to a group.  It worked great on the first couple of computers, but I discovered that on one computer it said the command ifmember was unrecognised, and then went on to map the drive anyway (even though they were not in the group)  Does ifmember need to be installed on all workstations too?  Here is an example of my script...

:accounts
ifmember accounts
if not errorlevel 1 goto next
echo Connecting to Accounts...
net use N: \\server1\accounts$

:next
0
pauljnye
Asked:
pauljnye
  • 2
1 Solution
 
tonyteriCommented:
Try this link it is very detailed and helpful on the ifmember comand.

/tt
0
 
pauljnyeAuthor Commented:
What link?
0
 
oBdACommented:
ifmember is not installed by default; it's part of the Resource Kit. You can start it from a network share, though; if you're using the logon script from the user's profile, you can just put ifmember.exe into the netlogon share as well.
The drive was mapped because ifmember wasn't found; this produced errorlevel 1, and so the drive was mapped.
0
 
pauljnyeAuthor Commented:
that worked.  In fact I tried that before you answered.  But thanks anyway!
Paul
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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