SBS 2003: Mapping network drives for users at logon
Sunday, February 7th, 2010Some time ago I installed an SBS 2003 server to act as Domain Controller/Exchange server/File and Print Server etc. The main aim was to centralise all the different locations of my data and printing needs into one manageable system. Although I am more than capable of mapping a drive manually and navigating to shared folders, I wanted a solution that did it all when I log onto my computers at home. Here is brief overview of what logon scripts do and how to get them working for you.
Everytime a user logs onto a windows domain a batch file is run from the NETLOGON folder on the domain controller, in this case, Windows Small Business Server 2003. The primary function of this file is to install any application that has been pushed to the client workstations. I wanted to amend this so that printers and shares were automatically allocated depending on the user who logs in.
For this example our server is called SBS, the user will be “ANother” and the folder we want to share is “Applications”. The first thing you need to do is find the logon script: it will be located here – “C:\WINDOWS\SYSVOL\sysvol\<domain name>\scripts\SBS_LOGIN_SCRIPT.bat”
The logon script will contain the line needed to add applications to users computers instead of manually installing them. For the sake of my setup I deleted this line as I do not need it but the line looks like this: “\\sbs\clients\setup\setup.exe /s sbs“. Please leave this line in if you plan to deploy software to workstations from the server.
Open up the SBS_LOGIN_SCRIPT.bat file (right click and select “edit”). What we are going to do is create a shortcut in this file to a file that matches the username of the logged on user. So add this line to the login script batch file, save it and close it. “\\sbs\netlogon\%username%.bat“
What this line does is look within the scripts folder for any batch files matching the username of the logged on user. So if Tom was to log on with his name “another” the login script will look for another.bat.
Now we can create out user files so we can map drives and printers specifically for them. I will cover printers in another post. Create a new file in the scripts folder and call it “another.bat” and open this up ready to edit. We need to add the applications share to Toms logon script.
In Toms file add the line: NET USE F \\sbs\applications
Save and close this file.
Now whenever Tom logs onto his computer the applications share will automatically be added as a network drive. All he has to do is go to “My Computer” and it will be listed for him to access. Of course we can go further than this and add shortcuts to the desktop and other mapped drives as well as printers and installs. I will not cover those here but check back for my update on adding default printers to a users account.
Everytime you add a new user to your domain, don’t forget to add a new batch file for that user and add in all the drives you want to map for them.
If you have any questions, comments and any other info just let me know.
Customising Firefox 3
Tuesday, May 13th, 2008If, like me you have recently upgraded to Firefox 3 and you have spent years using Tabbed Browser Preferences to manage your tabs position in the window, colour, order etc etc, then you, like me, are quite disappointed with the lack of configuration the tab bar has within Firefox 3.
Developer Comments: This extension is an enhancement for the basic tab controls provided in Firefox 1.0. It replaces the existing user interface with a new, more visible user interface, and also includes UI for other hidden features that are part of the browser, as well as features provided explicitly by the extension.
Tabbrowser Prefs is not currently available for Firefox 3 on Windows or Linux, which left me feeling frustrated. I would love to have felt annoyed, but can you really be annoyed when the info to build your very own plugin is out there?
I decided I had to do something. I had to have my tab bar on the bottom of the window at least. So, I went off and researched it.
After about 5 minutes I found out that the main interface to Firefox is controlled entirely by CSS. This is perfect. I located the CSS style sheet, googl’d some more and found the CSS variables needed to modify the interface settings. So now I am going to share it with everyone of you.
Ubuntu Hardy Heron Version
Open up nautilus and show hidden files. then navigate to:
- /home/.mozilla/firefox/your.profile/chrome
By default userChrome.css fie does not exist, so you need to create it before you can start adding your preferences. There’s actually an example file that exists by default, called userChrome-example.css. You can just rename that file by removing the -example part. Then open this file in leaf/mouse pad or any other text editor and add the following code and save it.
- /* Display the tabbar at the bottom */ #content > tabbox { -moz-box-direction: reverse; }
Windows XP/Vista Versions
Open up My Computer or File Explorer and show hidden files. then navigate to:
- C:\Documents andSettings\[UserName]\ApplicationData\Mozilla\Firefox\Profiles\your.proifile\chrome
By default userChrome.css fie does not exist, so you need to create it before you can start adding your preferences. There’s actually an example file that exists by default, called userChrome-example.css. You can just rename that file by removing the -example part. Then open this file in notepad or any other text editor and add the following code and save it.
- /* Display the tabbar at the bottom */ #content > tabbox { -moz-box-direction: reverse; }
PHP code to check server status
Tuesday, October 3rd, 2006Borntwisted came up with a wonderful idea to check that his free host was running without having to visit the a page or check the ftp.
He wrote a short piece of HTML that would pull an image off his website, if the server failed to respond the ALT tage would display OFFLINE.
I like to code things in php so I decided to take this a step further and not actually use any images, thus saving on bandwidth on my server everytime the page loads.
The full code is at the bottom of this post but I am going to break it down and try to explain how each section works.
First of all we need to connect to the server and check to see if a file exists. This file can be anything you like, I chose to use an image called online.gif.
I declared a variable call $url which holds the data needed to connect to the server. @fopen is the php command to connect to the server and open the chosen file. The reason the @ symbol is used is to supress the error that will be returned when the file cannot be found.
Using "r" tells the command we want to open the file in read only mode.
Now we use a simple ifelse statment to output the correct part of the formula. The first part of the formula as below asks if the condition is true (if file exists) and will output the command below it.
- if ($url) {
Before the command is outputted we have to close the connection to the file for security purposes. fclose closes the connection to the server which is defined again by our variable $url.
Now we can output the following command if the file is found on the server. Basically this is the TRUE part of the conditional statement. We now ECHO a line of code to the browser which will be converted into HTML and displayed as what you will see. Do not worry about the div's and classes, that is just CSS styling for the page I have this code on.
- }
The following code is the FALSE part of the staement, which is outputted if the above connection cannot find the file. It has similar styling to the above command but this time you will notice that the div class is set to "offline". This is so a different colour is displayed.
- else {
- }
- ?>
That's all there is to it. The code is simple and works well. If you use this code you may notice that when the file is removed by yourself the script doe snot update, this is simply because of the server it is on. Sometimes servers take a few minutes to update.
The code as a whole is listed below and I have also added the CSS that I have used. Modify to your needs.
- .holder{
- width:80px;
- margin-left:5px;
- }
- .name{
- float:left;
- }
- .online{
- text-align:center;
- width:8px;
- height:8px;
- padding:2px;
- background:#75f475;
- float:right;
- border:1px solid #000;
- margin-bottom:2px;
- }
- .offline{
- text-align:center;
- width:8px;
- height:8px;
- padding:2px;
- background:#ef2424;
- float:right;
- border:1px solid #000;
- margin-bottom:2px;
- }
Dynamic Menus for WordPress
Thursday, April 27th, 2006The standard WordPress navigation menu is limited in that it does not show sub menus. it will list every single page on your website in one long list in the navigation section.
For larger sites this can become troublsome. Who wants 50 links running down the side of the page just for the content. It can also be very confusing to site visitors.
I decided I needed a simple script to display the sub menu only when the parent page was clicked, - a working example of this is on the right hand side of this page - so I wrote a little script to do this, and in the spirit of open source, here is the turorial so that you can make it yourself.
Styling individual comments for WordPress
Thursday, April 20th, 2006I wanted a little script that would allow me to have specific styles for individual comments depending on the authour.
I had a look around for WordPress plugins and other info, but could not find anything that actually worked.
So I wrote my own little switch statment to sort it all out.
- <?php
- switch (comment_author_email){
- case ($comment->comment_author_email == 'friend@friend.com'):
- $style = '<div class="friendcomment">';
- break;
- case ($comment->comment_author_email == 'you@you.com'):
- $style = '<div class="authorcomment">';
- break;
- default:
- $style = '<div class="defaultcomment">';
- break;}?>
This involves modifying the comments.php file in your theme folder.
Find:
- <cite><?php comment_author_link() ?></cite>
And add this code above that line: Make sure you put the correct email addresses in.
- <?php
- switch (comment_author_email){
- case ($comment->comment_author_email == 'friend@friend.com'):
- $style = '<div class="friendcomment">';
- break;
- case ($comment->comment_author_email == 'you@you.com'):
- $style = '<div class="authorcomment">';
- break;
- default:
- $style = '<div class="defaultcomment">';
- break;}?>
Now find:
- <?php comment_text() ?>
Add the following on the line below:
- </div>
That's it for the comments.php file. Now open your style sheet, usually called style.css and add the following rules to the end of your style sheet, modify to yoru own needs.
- .authorcomment {
- background: #ffffcc;
- padding:10px;
- border:2px solid #000;
- color:#333;
- min-height:90px;
- }
- .friendcomment {
- background: #fff;
- padding:10px;
- border:2px solid #000;
- color:#333;
- min-height:90px;
- }
- .defaultcomment {
- background: #eee;
- padding:10px;
- border:2px solid #000;
- color:#333;
- min-height:90px;
- }
Thats everything. Save and upload your files and see for yourself.
Search
Previous Posts
- Building Your Own GIT Server – Part 1 Posted by Soddengecko February 3, 2012
- Enable Airprint on Ubuntu Posted by Soddengecko June 27, 2011
- Ubuntu Install Screenshots Posted by Soddengecko February 7, 2010
- HOW TO: Move Ubuntu Home folder to another drive Posted by Soddengecko February 7, 2010
- HOW TO: Random password generator on Ubuntu and other Linux systems Posted by Soddengecko February 7, 2010
- HOW TO: Perform system backup in Ubuntu – Part 2 – Restore Posted by Soddengecko February 7, 2010
- HOW TO: Perform system backup in Ubuntu – Part 1 – Backup Posted by Soddengecko February 7, 2010
- SBS 2003: Mapping network drives for users at logon Posted by Soddengecko February 7, 2010
- Sharepoint Services not configured for use with ASP.NET 2.xxxxx Posted by Soddengecko November 26, 2009
- Customising Firefox 3 Posted by Soddengecko May 13, 2008
Recently Updated
Archives
People
Linkies
- Matthew Moore This blog belongs to an associate of mine. He likes to jibber jabber on a bit, and he has decided to document his exercising habits lately, but look back and check out some of the good stuff. Added on March 22nd, 2008 @ 12:08
- Fight for Kisses Probably the best shaving advert I have seen. Not much by the way of pretentious bullshit and it actually has a couple of funny moments. Worth a watch. Added on October 25th, 2007 @ 09:52
- Speedtest.net Speedtest.net is a broadband connection analysis tool with a huge selection of geographically dispersed testing servers. Ookla provides this service free to hundreds of thousands of people every day. If you are experiencing slowness with your Internet connection or are simply interested in testing your speed, Speedtest.net is for you. Added on October 15th, 2007 @ 22:09
- Sadikhov Forums A forum of like minded people helping others achieve the coveted CCNA qualification. The site is aimed at helping those understand the complex issues presented in the exams and making sure you understand them before wasting your money. Added on October 15th, 2007 @ 22:09
- RouterSim.com RouterSim has been the leader in IT simulation training since 1999. RouterSim's Industry expert Todd Lammle offers you the best learning tools available. We have expanded our offerings to match your budget and needs. RouterSim offers simulators, computer-based training videos, online CCNA simulation testing, and exam preparation software. Added on October 15th, 2007 @ 22:08
- Generic Linux rules of thumb for security The only secure box is turned off and locked in the back room -- but it's also not much use to anyone Added on October 15th, 2007 @ 22:06




by @ 20:07