TheFanatic
MIS
Not sure if this is the right forum...
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
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