tobycruz
asked on
ifmember login script syntax
trying to create a login script using "ifmember" i want batch file to add a printer based on group membership, i also need to add shortcuts to the desktop and map some network drives below is what i have so far but it doenst seem to work
ifmember "PT Data Production"
rundll32 printui.dll,PrintUIEntry /in /u /z /n"\\blackberry2\BB2_BW_Pr od_4300"
rundll32 printui.dll,PrintUIEntry /y /n"\\blackberry2\BB2_BW_Pr od_4300"
copy /y "\\nycluster\share\Applica tions\Prod uction Resources.lnk" "C:\documents and settings\%username%\deskto p"
copy /y "\\nycluster\share\Applica tions\Laun ch DMS.url" "C:\documents and settings\%username%\deskto p"
copy /y "\\nycluster\share\Applica tions\Laun ch Training DMS.url" "C:\documents and settings\%username%\deskto p"
net use s: /delete
net use u: /delete
net use S: \\nyprodsrv\share
net use U: \\nycluster\share
pause
ifmember "PT Data Production"
rundll32 printui.dll,PrintUIEntry /in /u /z /n"\\blackberry2\BB2_BW_Pr
rundll32 printui.dll,PrintUIEntry /y /n"\\blackberry2\BB2_BW_Pr
copy /y "\\nycluster\share\Applica
copy /y "\\nycluster\share\Applica
copy /y "\\nycluster\share\Applica
net use s: /delete
net use u: /delete
net use S: \\nyprodsrv\share
net use U: \\nycluster\share
pause
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You need to use ...
ifmember "DOMAIN\PT Data Production"
where domain is the netbios name of your domain.
ifmember "DOMAIN\PT Data Production"
where domain is the netbios name of your domain.
Echo Off
IfMember "MyDomain\UserName" | FIND /I "matches" >NUL
IF NOT ErrorLevel 1 (
rundll32 printui.dll,PrintUIEntry /in /u /z /n"\\blackberry2\BB2_BW_Pr
rundll32 printui.dll,PrintUIEntry /y /n"\\blackberry2\BB2_BW_Pr
copy /y "\\nycluster\share\Applica
copy /y "\\nycluster\share\Applica
copy /y "\\nycluster\share\Applica
net use s: /delete
net use u: /delete
net use S: \\nyprodsrv\share
net use U: \\nycluster\share
)