|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ifmember logon script?
Hello,
Years ago in Novell I remember doing an ifmember logon script - eg. ifmember of sales map shared drive to the sales share. I never got one to work using a batch file (not vb script) for Windows 2003. Is there an easy way of doing this so that whatever ifmember type command is used, the workstation will be able to run it without having a local copy? If the logon script batch file and ifmember.exe are in the same folder it
should be easy to do. When you call it, just specify the script's directory like this: %0\..\IfMember.exe Show quote "boe" <boe_d@nospam.hotmail.com> wrote in message news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl... > Hello, > > Years ago in Novell I remember doing an ifmember logon script - eg. > ifmember of sales map shared drive to the sales share. > > I never got one to work using a batch file (not vb script) for Windows > 2003. Is there an easy way of doing this so that whatever ifmember type > command is used, the workstation will be able to run it without having a > local copy? > Thanks for getting back to me so quickly - I've never seen the %0\ thing
before - if you have any more info I would really appreciate the assist. Show quote "Marty List" <use***@optimumx.com> wrote in message news:O25$3Y%23kFHA.3936@TK2MSFTNGP10.phx.gbl... > > If the logon script batch file and ifmember.exe are in the same folder it > should be easy to do. When you call it, just specify the script's > directory like this: > > %0\..\IfMember.exe > > > "boe" <boe_d@nospam.hotmail.com> wrote in message > news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl... >> Hello, >> >> Years ago in Novell I remember doing an ifmember logon script - eg. >> ifmember of sales map shared drive to the sales share. >> >> I never got one to work using a batch file (not vb script) for Windows >> 2003. Is there an easy way of doing this so that whatever ifmember type >> command is used, the workstation will be able to run it without having a >> local copy? >> > > I don't know if it's officially documented by Microsoft, but it's used in
some of their knowledge base articles and it's been around forever. It looks strange at first but it makes sense when you think about it. If you pass parameters to a batch file, you access them with %1, %2, etc. And the batch file itself is %0 (although it's not included with the other parameters when you use "%*"). Every directory has . and .. entries, these are handy references to itself and the parent directory. Explorer and most GUI apps hide them but DIR shows them. So if you specify "%0\.." you're referencing the parent directory of the batch file. Run this script, the output might help explain it (just don't save the batch file to the root of the drive): @Echo On Echo %%0: [%0] Dir %0 Dir %0\.. Dir %0\..\. Dir %0\..\.. Show quote "boe" <boe_d@nospam.hotmail.com> wrote in message news:uv8Oxs%23kFHA.320@TK2MSFTNGP09.phx.gbl... > Thanks for getting back to me so quickly - I've never seen the %0\ thing > before - if you have any more info I would really appreciate the assist. > > "Marty List" <use***@optimumx.com> wrote in message > news:O25$3Y%23kFHA.3936@TK2MSFTNGP10.phx.gbl... >> >> If the logon script batch file and ifmember.exe are in the same folder it >> should be easy to do. When you call it, just specify the script's >> directory like this: >> >> %0\..\IfMember.exe >> >> >> "boe" <boe_d@nospam.hotmail.com> wrote in message >> news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl... >>> Hello, >>> >>> Years ago in Novell I remember doing an ifmember logon script - eg. >>> ifmember of sales map shared drive to the sales share. >>> >>> I never got one to work using a batch file (not vb script) for Windows >>> 2003. Is there an easy way of doing this so that whatever ifmember type >>> command is used, the workstation will be able to run it without having a >>> local copy? >>> >> >> > > OK - I think I see what the "%0 is for - I'll have to test next week if I
can run a batch command from a workstation that references the server (e.g. -\\myserver) ifmember command. I'm sure it can be done, I just have to do some testing. Show quote "Marty List" <use***@optimumx.com> wrote in message news:%230k1W8%23kFHA.3148@TK2MSFTNGP09.phx.gbl... > > I don't know if it's officially documented by Microsoft, but it's used in > some of their knowledge base articles and it's been around forever. It > looks strange at first but it makes sense when you think about it. > > If you pass parameters to a batch file, you access them with %1, %2, etc. > And the batch file itself is %0 (although it's not included with the other > parameters when you use "%*"). Every directory has . and .. entries, > these are handy references to itself and the parent directory. Explorer > and most GUI apps hide them but DIR shows them. > > So if you specify "%0\.." you're referencing the parent directory of the > batch file. > > Run this script, the output might help explain it (just don't save the > batch file to the root of the drive): > > @Echo On > Echo %%0: [%0] > Dir %0 > Dir %0\.. > Dir %0\..\. > Dir %0\..\.. > > > > "boe" <boe_d@nospam.hotmail.com> wrote in message > news:uv8Oxs%23kFHA.320@TK2MSFTNGP09.phx.gbl... >> Thanks for getting back to me so quickly - I've never seen the %0\ thing >> before - if you have any more info I would really appreciate the assist. >> >> "Marty List" <use***@optimumx.com> wrote in message >> news:O25$3Y%23kFHA.3936@TK2MSFTNGP10.phx.gbl... >>> >>> If the logon script batch file and ifmember.exe are in the same folder >>> it should be easy to do. When you call it, just specify the script's >>> directory like this: >>> >>> %0\..\IfMember.exe >>> >>> >>> "boe" <boe_d@nospam.hotmail.com> wrote in message >>> news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl... >>>> Hello, >>>> >>>> Years ago in Novell I remember doing an ifmember logon script - eg. >>>> ifmember of sales map shared drive to the sales share. >>>> >>>> I never got one to work using a batch file (not vb script) for Windows >>>> 2003. Is there an easy way of doing this so that whatever ifmember type >>>> command is used, the workstation will be able to run it without having >>>> a local copy? >>>> >>> >>> >> >> > > "boe" <boe_d@nospam.hotmail.com> wrote in message You can forego using 'ifmember.exe' if you wish. Something like thisnews:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl... > Hello, > > Years ago in Novell I remember doing an ifmember logon script - eg. > ifmember of sales map shared drive to the sales share. > > I never got one to work using a batch file (not vb script) for Windows 2003. > Is there an easy way of doing this so that whatever ifmember type command is > used, the workstation will be able to run it without having a local copy? should work: net.exe group "groupname" /domain|find /I "%username%">NUL:&&Echo Yes to membership Since 'net.exe' comes standard with NT/2K/XP, you would not need to add 'ifmember.exe' to your sets or NETLOGON directory. This will work, unless nested groups are being used. The 'Net.exe Group'
command only enumerates the group's direct members by name, but IfMember.exe enumerates all the SIDs in your access token. Show quote "James Whitlow" <jwhit***@letter.com> wrote in message news:ekXpT5FlFHA.3960@TK2MSFTNGP12.phx.gbl... > "boe" <boe_d@nospam.hotmail.com> wrote in message > news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl... > > Hello, > > > > Years ago in Novell I remember doing an ifmember logon script - eg. > > ifmember of sales map shared drive to the sales share. > > > > I never got one to work using a batch file (not vb script) for Windows > 2003. > > Is there an easy way of doing this so that whatever ifmember type command > is > > used, the workstation will be able to run it without having a local copy? > > You can forego using 'ifmember.exe' if you wish. Something like this > should work: > > net.exe group "groupname" /domain|find /I "%username%">NUL:&&Echo Yes to > membership > > Since 'net.exe' comes standard with NT/2K/XP, you would not need to add > 'ifmember.exe' to your sets or NETLOGON directory. > > |
|||||||||||||||||||||||