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

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
yostnetAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yostnetAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.