Guest JohnB Posted April 24, 2008 Posted April 24, 2008 I have been, in various forms and titles, working in the network administration field for some 20 years now. But with my previous employer, I did much less of that and, more on the project management side of things. Well now after having been "right-sized" I am looking at getting into network admin again. In the past I always used traditional batch files for login scripts. And now I'm wondering if this is still the preferred method. I have done some VB scripting in the past, but always thought you ended up with many more lines of code with that method. I know there are some other options our there like kixtart, but I have only "played" with those, never used them in production. What do you use for your login scripts, and why did you choose that option?
Guest Pegasus \(MVP\) Posted April 24, 2008 Posted April 24, 2008 Re: Survey: what do you use to create Login scripts "JohnB" <jbrigan@yahoo.com> wrote in message news:u9othTjpIHA.6096@TK2MSFTNGP06.phx.gbl... >I have been, in various forms and titles, working in the network >administration field for some 20 years now. But with my previous employer, >I did much less of that and, more on the project management side of things. >Well now after having been "right-sized" I am looking at getting into >network admin again. > > In the past I always used traditional batch files for login scripts. And > now I'm wondering if this is still the preferred method. I have done some > VB scripting in the past, but always thought you ended up with many more > lines of code with that method. I know there are some other options our > there like kixtart, but I have only "played" with those, never used them > in production. > > What do you use for your login scripts, and why did you choose that > option? > I use batch files each and every time. Under Win2000/XP they have become sufficiently versatile to perform 95% of all jobs. If I have a specific requirement that is beyond the capabilities of a batch file then I invoke a tailor-made VB script from within the batch file. I find VB scripts both unnecessary and too verbose for everyday tasks. As an example: To keep a local folder (including subfolders) up-to-date requires lots of VB script lines. With robocopy or xcopy I can do the job in a single line of code.
Guest Herb Martin Posted April 24, 2008 Posted April 24, 2008 Re: Survey: what do you use to create Login scripts "JohnB" <jbrigan@yahoo.com> wrote in message news:u9othTjpIHA.6096@TK2MSFTNGP06.phx.gbl... >I have been, in various forms and titles, working in the network >administration field for some 20 years now. But with my previous employer, >I did much less of that and, more on the project management side of things. >Well now after having been "right-sized" I am looking at getting into >network admin again. > > In the past I always used traditional batch files for login scripts. And > now I'm wondering if this is still the preferred method. It's what I do mostly. And I write a LOT of scripts. (For admin task I tend to use Perl [or sometimes Ruby and PHP lately but Perl is on ALL of my machiens]). > I have done some VB scripting in the past, but always thought you ended up > with many more lines of code with that method. I know there are some > other options our there like kixtart, but I have only "played" with those, > never used them in production. > > What do you use for your login scripts, and why did you choose that > option? I try to use straight batch with only built-in tools so that they will "run anywhere". When they are too complicated for that, I generally use Perl, or white a custom C(++) app to do the hard part, especially if the hard part is something reusuable and useful in the future.
Guest Richard Mueller [MVP] Posted April 24, 2008 Posted April 24, 2008 Re: Survey: what do you use to create Login scripts JohnB wrote: >I have been, in various forms and titles, working in the network >administration field for some 20 years now. But with my previous employer, >I did much less of that and, more on the project management side of things. >Well now after having been "right-sized" I am looking at getting into >network admin again. > > In the past I always used traditional batch files for login scripts. And > now I'm wondering if this is still the preferred method. I have done some > VB scripting in the past, but always thought you ended up with many more > lines of code with that method. I know there are some other options our > there like kixtart, but I have only "played" with those, never used them > in production. > > What do you use for your login scripts, and why did you choose that > option? > I used to use batch files for everything (10 years ago), but I use VBScript programs almost exclusively now. There are many new capabilities in batch language, but they don't work on older clients, plus they are harder to read (for me). I like code that anyone can understand. VBScript often requires more lines of code, but that does not make them slower. I find too many things that can only be done with ADSI and VBScript. Copying files is easier in batch language, but checking group membership is especially important in logon scripts, and this can only be done in batch files if you use third party tools. I can always run command line tools like xcopy, calcs, or ping from a VBScript program. In the future most admins will use PowerShell for admin tasks, which in some ways is similar to batch language, but requires .NET. This won't be good for logon scripts until more capabilities come out from Microsoft. -- Richard Mueller Microsoft MVP Scripting and ADSI Hilltop Lab - http://www.rlmueller.net --
Guest Herb Martin Posted April 24, 2008 Posted April 24, 2008 Re: Survey: what do you use to create Login scripts "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in message news:%23F8WK0kpIHA.3804@TK2MSFTNGP02.phx.gbl... > JohnB wrote: > In the future most admins will use PowerShell for admin tasks, which in > some ways is similar to batch language, but requires .NET. This won't be > good for logon scripts until more capabilities come out from Microsoft. I am a "script guy" but highly doubt that PowerShell will be what "most admins" use. One serious problem is that PowerShell is practically worthless as an ordinary (manual, interactive) command shell -- most users will find it too "Unix like" to use easily, but not enough like them to use regularly (habitually.) My opinion ... only.
Guest JohnB Posted April 25, 2008 Posted April 25, 2008 Re: Survey: what do you use to create Login scripts Yes, that was one of the things I was wondering what others do; what if you're doing something like testing for group membership... but that requires a 3rd party tool. > > I try to use straight batch with only built-in tools so that they will > "run anywhere". >
Guest JohnB Posted April 25, 2008 Posted April 25, 2008 Re: Survey: what do you use to create Login scripts Yeah, I've always wondered why Microsoft chose not to go the same route as Novell; to use built-in scripting. To me that's always been a glaring omission from the server versions of Windows. Or maybe they considered batch files to be just that. Then if that's the case, they sure have could have done a better job, by adding things such as a command to test for group membership. "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in message ... > In the future most admins will use PowerShell for admin tasks, which in > some ways is similar to batch language, but requires .NET. This won't be > good for logon scripts until more capabilities come out from Microsoft. > > -- > Richard Mueller > Microsoft MVP Scripting and ADSI > Hilltop Lab - http://www.rlmueller.net > -- > >
Guest JohnB Posted April 25, 2008 Posted April 25, 2008 Re: Survey: what do you use to create Login scripts Thanks for the feedback. "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message news:OiysEWkpIHA.1240@TK2MSFTNGP02.phx.gbl... > > "JohnB" <jbrigan@yahoo.com> wrote in message > news:u9othTjpIHA.6096@TK2MSFTNGP06.phx.gbl... >>I have been, in various forms and titles, working in the network >>administration field for some 20 years now. But with my previous >>employer, I did much less of that and, more on the project management side >>of things. Well now after having been "right-sized" I am looking at >>getting into network admin again. >> >> In the past I always used traditional batch files for login scripts. And >> now I'm wondering if this is still the preferred method. I have done >> some VB scripting in the past, but always thought you ended up with many >> more lines of code with that method. I know there are some other options >> our there like kixtart, but I have only "played" with those, never used >> them in production. >> >> What do you use for your login scripts, and why did you choose that >> option? >> > > I use batch files each and every time. Under Win2000/XP they have > become sufficiently versatile to perform 95% of all jobs. If I have a > specific requirement that is beyond the capabilities of a batch file then > I invoke a tailor-made VB script from within the batch file. > > I find VB scripts both unnecessary and too verbose for everyday > tasks. As an example: To keep a local folder (including subfolders) > up-to-date requires lots of VB script lines. With robocopy or xcopy > I can do the job in a single line of code. >
Guest Herb Martin Posted April 25, 2008 Posted April 25, 2008 Re: Survey: what do you use to create Login scripts "JohnB" <jbrigan@yahoo.com> wrote in message news:OIxll4tpIHA.3680@TK2MSFTNGP05.phx.gbl... > Yes, that was one of the things I was wondering what others do; what if > you're doing something like testing for group membership... but that > requires a 3rd party tool. IfMember.exe from the ResKit works ok; it's free and from Microsoft. It is my habit to have the ResKit, support tools, Perl, UnxTools (Gnu for Win32), and a large collection of my own Bat/Cmd files on or available to each machine. >> I try to use straight batch with only built-in tools so that they will >> "run anywhere".
Guest kj [SBS MVP] Posted April 25, 2008 Posted April 25, 2008 Re: Survey: what do you use to create Login scripts JohnB wrote: > Yes, that was one of the things I was wondering what others do; what > if you're doing something like testing for group membership... but > that requires a 3rd party tool. No it doesn't but it does require some scripting abilities. Even an amateur scripter like me can leverage the work of good scripters to accomplish this objective. Go look on scriptcenter and see whats already there and how to customize for your own environment. http://www.microsoft.com/technet/scriptcenter/default.mspx (Sample snipit supplied below) -- Const Test1_GROUP = "cn=test1" Const Test2_GROUP = "cn=test2" Const Test3_GROUP = "cn=test3" Set wshNetwork = CreateObject("WScript.Network") 'wshNetwork.MapNetworkDrive "k:", "\\FileServer\Users\" & wshNetwork.UserName Set ADSysInfo = CreateObject("ADSystemInfo") Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName) strGroups = LCase(Join(CurrentUser.MemberOf)) WScript.Echo strGroups If InStr(strGroups, Test1_GROUP) Then wshNetwork.MapNetworkDrive "l:", "\\sbs1\test1" ' wshNetwork.AddWindowsPrinterConnection "\\PrintServer\EngLaser" ' wshNetwork.AddWindowsPrinterConnection "\\PrintServer\Plotter" ' wshNetWork.SetDefaultPrinter "\\PrintServer\EngLaser" WScript.Echo "Map Drive L" End if ----- > > >> >> I try to use straight batch with only built-in tools so that they >> will "run anywhere". -- /kj
Guest Herb Martin Posted April 25, 2008 Posted April 25, 2008 Re: Survey: what do you use to create Login scripts "kj [sBS MVP]" <KevinJ.SBS@SPAMFREE.gmail.com> wrote in message news:%23jDwnEvpIHA.4280@TK2MSFTNGP02.phx.gbl... > JohnB wrote: >> Yes, that was one of the things I was wondering what others do; what >> if you're doing something like testing for group membership... but >> that requires a 3rd party tool. > > No it doesn't but it does require some scripting abilities. Even an > amateur scripter like me can leverage the work of good scripters to > accomplish this objective. > > Go look on scriptcenter and see whats already there and how to customize > for your own environment. > > http://www.microsoft.com/technet/scriptcenter/default.mspx Good advice -- and pay particular attention to the "Script-O-Matic" located there; either for ADSI or WMI. > (Sample snipit supplied below) > -- > > Const Test1_GROUP = "cn=test1" > Const Test2_GROUP = "cn=test2" > Const Test3_GROUP = "cn=test3" > > Set wshNetwork = CreateObject("WScript.Network") > 'wshNetwork.MapNetworkDrive "k:", "\\FileServer\Users\" & > wshNetwork.UserName > > Set ADSysInfo = CreateObject("ADSystemInfo") > Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName) > strGroups = LCase(Join(CurrentUser.MemberOf)) > WScript.Echo strGroups > > If InStr(strGroups, Test1_GROUP) Then > > wshNetwork.MapNetworkDrive "l:", "\\sbs1\test1" > ' wshNetwork.AddWindowsPrinterConnection "\\PrintServer\EngLaser" > ' wshNetwork.AddWindowsPrinterConnection "\\PrintServer\Plotter" > ' wshNetWork.SetDefaultPrinter "\\PrintServer\EngLaser" > WScript.Echo "Map Drive L" > > End if > > ----- >> >> >>> >>> I try to use straight batch with only built-in tools so that they >>> will "run anywhere". > > -- > /kj >
Guest kj [SBS MVP] Posted April 25, 2008 Posted April 25, 2008 Re: Survey: what do you use to create Login scripts Herb Martin wrote: > "kj [sBS MVP]" <KevinJ.SBS@SPAMFREE.gmail.com> wrote in message > news:%23jDwnEvpIHA.4280@TK2MSFTNGP02.phx.gbl... >> JohnB wrote: >>> Yes, that was one of the things I was wondering what others do; what if >>> you're doing something like testing for group membership... >>> but that requires a 3rd party tool. >> >> No it doesn't but it does require some scripting abilities. Even an >> amateur scripter like me can leverage the work of good scripters to >> accomplish this objective. >> >> Go look on scriptcenter and see whats already there and how to >> customize for your own environment. >> >> http://www.microsoft.com/technet/scriptcenter/default.mspx > > Good advice -- and pay particular attention to the "Script-O-Matic" > located there; either for ADSI or WMI. Yes, I meant to mention script-o, thanks Herb. Script-o is great too, for so many things. > >> (Sample snipit supplied below) >> -- >> >> Const Test1_GROUP = "cn=test1" >> Const Test2_GROUP = "cn=test2" >> Const Test3_GROUP = "cn=test3" >> >> Set wshNetwork = CreateObject("WScript.Network") >> 'wshNetwork.MapNetworkDrive "k:", "\\FileServer\Users\" & >> wshNetwork.UserName >> >> Set ADSysInfo = CreateObject("ADSystemInfo") >> Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName) >> strGroups = LCase(Join(CurrentUser.MemberOf)) >> WScript.Echo strGroups >> >> If InStr(strGroups, Test1_GROUP) Then >> >> wshNetwork.MapNetworkDrive "l:", "\\sbs1\test1" >> ' wshNetwork.AddWindowsPrinterConnection "\\PrintServer\EngLaser" >> ' wshNetwork.AddWindowsPrinterConnection "\\PrintServer\Plotter" >> ' wshNetWork.SetDefaultPrinter "\\PrintServer\EngLaser" >> WScript.Echo "Map Drive L" >> >> End if >> >> ----- >>> >>> >>>> >>>> I try to use straight batch with only built-in tools so that they >>>> will "run anywhere". >> >> -- >> /kj -- /kj
Guest stufeatherston@gmail.com Posted April 25, 2008 Posted April 25, 2008 Re: Survey: what do you use to create Login scripts Re: Survey: what do you use to create Login scripts On Apr 24, 12:58 pm, "JohnB" <jbri...@yahoo.com> wrote: > I have been, in various forms and titles, working in the network > administration field for some 20 years now. But with my previous employer, > I did much less of that and, more on the project management side of things. > Well now after having been "right-sized" I am looking at getting into > network admin again. > > In the past I always used traditional batch files for login scripts. And > now I'm wondering if this is still the preferred method. I have done some > VB scripting in the past, but always thought you ended up with many more > lines of code with that method. I know there are some other options our > there like kixtart, but I have only "played" with those, never used them in > production. > > What do you use for your login scripts, and why did you choose that option? I use VBScript or Batch files. I guess the reason that I use them is I am familiar with the syntax of them and they run without installing any other software, like Perl for example.
Guest DevilsPGD Posted April 27, 2008 Posted April 27, 2008 Re: Survey: what do you use to create Login scripts In message <ucM0n6tpIHA.4376@TK2MSFTNGP06.phx.gbl> "JohnB" <jbrigan@yahoo.com> wrote: >Yeah, I've always wondered why Microsoft chose not to go the same route as >Novell; to use built-in scripting. To me that's always been a glaring >omission from the server versions of Windows. Or maybe they considered >batch files to be just that. Then if that's the case, they sure have could >have done a better job, by adding things such as a command to test for group >membership. Batchfiles, VBScript, and now Powershell... What more do you want?
Recommended Posts