[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

IFMEMBER not returning the groups that a user is a part of.

Posted on 2008-02-12
2
Medium Priority
?
451 Views
Last Modified: 2010-04-21
I am trying to use IFMEMBER.exe to determine whether a user is part of a Group for drive mapping purposes.

As a test I am logged on as Administrator - Which I have added to some of the groups listed below.

If I perform an IFMEMBER /v /l is does not show the groups that I have made Administrator part of.
C:\>ifmember /v /l
User is a member of group CSC\Domain Users.
User is a member of group \Everyone.
User is a member of group BUILTIN\Administrators.
User is a member of group BUILTIN\Users.
User is a member of group BUILTIN\Pre-Windows 2000 Compatible Access.
User is a member of group NT AUTHORITY\REMOTE INTERACTIVE LOGON.
User is a member of group NT AUTHORITY\INTERACTIVE.
User is a member of group NT AUTHORITY\Authenticated Users.
User is a member of group NT AUTHORITY\This Organization.
User is a member of group \LOCAL.
User is a member of group CSC\Group Policy Creator Owners.
User is a member of group CSC\Domain Admins.
User is a member of group CSC\Enterprise Admins.
User is a member of group CSC\Schema Admins.

Why does it not show the other groups that I have made Administrator part of?
++++++++++++++++++++++++++++++++++


ECHO

NET USE H: \\CSCDC01\Users$\%username% /PERSISTENT:NO
NET USE I: \\CSCDC01\Shared$ /PERSISTENT:NO


:ENGINEERING
REM MAP DRIVE FOR ENGINEERING G:
IFMEMBER Engineering_group
IF NOT %errorlevel% EQU 1 GOTO ACCOUNTING
NET USE G: \\CSCDC01\Engineering$ /PERSISTENT:NO

:ACCOUNTING
REM MAP DRIVE FOR ACCOUNTING J:
IFMEMBER Accounting_group
IF NOT %errorlevel% EQU 1 GOTO ADMINISTRATION
net use J: \\CSCDC01\Accounting$ /PERSISTENT:NO

:ADMINISTRATION
REM MAP DRIVE FOR ADMINISTRATION K:
IFMEMBER Accounting_group
IF NOT %errorlevel% EQU 1 GOTO CUSTOMER
net use K: \\CSCDC01\Administration$ /PERSISTENT:NO

:CUSTOMER
REM MAP DRIVE FOR CUSTOMER L:
IFMEMBER CustomerService_group
IF NOT %errorlevel% EQU 1 GOTO FINANCIALS
net use L: \\CSCDC01\Customer$ /PERSISTENT:NO

:FINANCIALS
REM MAP DRIVE FOR FINANCIALS M:
pause
IFMEMBER Financials_group
IF NOT %errorlevel% EQU 1 GOTO EXECUTIVE
net use M: \\CSCDC01\Financial$ /PERSISTENT:NO

:EXECUTIVE
REM MAP DRIVE FOR EXECUTIVE N:
IFMEMBER Executive_group
IF NOT %errorlevel% EQU 1 GOTO HR
net use N: \\CSCDC01\Executive$ /PERSISTENT:NO

:HR
REM MAP DRIVE FOR HR O:
IFMEMBER HR_group
IF NOT %errorlevel% EQU 1 GOTO PLANT
net use O: \\CSCDC01\HR$ /PERSISTENT:NO

:PLANT
REM MAP DRIVE FOR PLANT P:
IFMEMBER Plant_group
IF NOT %errorlevel% EQU 1 GOTO PURCHASING
net use P: \\CSCDC01\Plant$ /PERSISTENT:NO

:PURCHASING
REM MAP DRIVE FOR PLANT R:
IFMEMBER Purchasing_group
IF NOT %errorlevel% EQU 1 GOTO SALES
net use R: \\CSCDC01\Purchasing$ /PERSISTENT:NO

:SALES
REM MAP DRIVE FOR PLANT T:
IFMEMBER Sales_group
IF NOT %errorlevel% EQU 1 GOTO DONE
net use T: \\CSCDC01\Sales$ /PERSISTENT:NO

:DONE
EXIT
0
Comment
Question by:yostnet
2 Comments
 
LVL 86

Accepted Solution

by:
oBdA earned 2000 total points
ID: 20876840
You need to logoff and log back on again before running ifmember when you changed the group membership for an account; the access token that contains your group membership is only refreshed during logon.
0
 

Author Closing Comment

by:yostnet
ID: 31430219
I had done that just after I sent out the note. thanks and I am giving the points anyways as you nailed it and were responsive.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A bad practice commonly found during an account life cycle is to set its password to an initial, insecure password. The Password Reset Tool was developed to make the password reset process easier and more secure.
Sometimes it necessary to set special permissions on user objects.  For instance when using a Blackberry server, the SendAs permission needs to be set. I see many admins struggle with the setting that permission only to see it disappear within a few…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question