eazstream
asked on
Need help with ifmember and group mapping on login script
Hello,
I really appreciate anyones help on this, i was able to create a login script in notepad as a batch file and test it for user's personal home fodlers and shared folders. but im having huge issue with assigning groups to their groups folder, i know you can't do that in notepad as a batch file without using ifmember.exe. My problem is Idont know how to work ifmember.exe. i installed and copied the ifmember executable to the same path that the script is located in my PDC. as required, and thought i enter the right commands but when i run it nothing happens, just my original commands works. Not the ifmember. Please help
here is a copy of my test.bat file
REM *** Login Script for Company Users ***
net use i: /delete
net use g: /delete
net use h: /delete
net use m: /delete
net use n: /delete
net use g: \\servername-fs03\prog
net use h: \\servername-fs03\data
net use i: \\servername-fs02\%usernam e%$
net use m: \\servername-fs03\data
net use n: \\servername-fs01\apps
ifmember DomainAdmins
if not errorlevel 1 goto EndDomainAdmins
net use z: \\servername-fs03\data
:EndDomainAdmins
REM call \\empire-dc01\netlogon\acc pac_forms. bat
REM call \\empire-dc01\netlogon\acc ess.bat
-------------------------- ---------- ------
after running this the only drives that gets mapped are the G,H,I,M,N no Z drive which is the ifmember command.
Thank you
Eddie
I really appreciate anyones help on this, i was able to create a login script in notepad as a batch file and test it for user's personal home fodlers and shared folders. but im having huge issue with assigning groups to their groups folder, i know you can't do that in notepad as a batch file without using ifmember.exe. My problem is Idont know how to work ifmember.exe. i installed and copied the ifmember executable to the same path that the script is located in my PDC. as required, and thought i enter the right commands but when i run it nothing happens, just my original commands works. Not the ifmember. Please help
here is a copy of my test.bat file
REM *** Login Script for Company Users ***
net use i: /delete
net use g: /delete
net use h: /delete
net use m: /delete
net use n: /delete
net use g: \\servername-fs03\prog
net use h: \\servername-fs03\data
net use i: \\servername-fs02\%usernam
net use m: \\servername-fs03\data
net use n: \\servername-fs01\apps
ifmember DomainAdmins
if not errorlevel 1 goto EndDomainAdmins
net use z: \\servername-fs03\data
:EndDomainAdmins
REM call \\empire-dc01\netlogon\acc
REM call \\empire-dc01\netlogon\acc
--------------------------
after running this the only drives that gets mapped are the G,H,I,M,N no Z drive which is the ifmember command.
Thank you
Eddie
Try this...
ifmember "Domain\Domain Admins"
if not %errorlevel% EQU 1 goto EndDomainAdmins
echo Now mapping Z for the Domain Admins group..
net use z: \\servername-fs03\data
:EndDomainAdmins
ifmember "Domain\Domain Admins"
if not %errorlevel% EQU 1 goto EndDomainAdmins
echo Now mapping Z for the Domain Admins group..
net use z: \\servername-fs03\data
:EndDomainAdmins
ASKER
sorry about that typo
i do have it as
domain name\domain Admins
thanks ..
i do have it as
domain name\domain Admins
thanks ..
But is it enclosed in quotes?
ASKER
sirbounty worked liked a charm...
can you please explain doesnt have to be in detail what i did wrong with my command...just curious i was searching and experimenting for two days now.. now thanks to you it works...lol
can you please explain doesnt have to be in detail what i did wrong with my command...just curious i was searching and experimenting for two days now.. now thanks to you it works...lol
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ifmember "Domain\Domain Admins"
where Domain is your domain name...