Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Trouble with ifmember and a login script to map drives

Sep 5, 2007 1:35AM PDT

I wrote this script (more like plagerized from various sources) to map drives based on group membership. The top part of the script runs fine. But once the script gets to the ifmember statements it just scrolls right through them to the end and no drives are mapped no matter the group membership. Been beating my head against the wall on this one. Can someone point out something I am missing?

net time \\DomController /set /y
net use o: /delete
net use s: /delete
net use s: \\Server\departments
\\AVServer\ofcscan\autopcc.exe
IF NOT EXIST %windir%\IFMEMBER.EXE copy \\DomController\netlogon\ifmember.exe %windir%

:"Auburn WA"
ifmember.exe "Auburn WA"
if not errorlevel 1 goto "Dallas TX"
net use o: \\Server\auburn
goto quit

:"Dallas TX"
ifmember "Dallas TX"
if not errorlevel 1 goto "Phoenix AZ"
net use o: \\Server\Dallas
goto quit

:"Phoenix AZ"
ifmember "Phoenix AZ"
if not errorlevel 1 goto "Central Florida FL"
net use o: \\Server\Phoenix
goto quit

:"Central Florida FL"
ifmember "Central Florida FL"
if not errorlevel 1 goto "Sacromento CA"
net use o: \\Server\Centralflorida
goto quit

Discussion is locked