Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Sunday, 27 September 2009

How do you select all items from a SQL table ?

This is probably the first thing you will ever do with SQL and it's a nice easy one to get you started.

Open query analyser.
Select the required database (This can be done from the drop down menu or by typing "Use [database name"])

Type :

Select * from [table name]

This will now return all the records in the table.

Hide System Tables and Objects in MS SQL 2000 Enterprise Manager

Recently I have been working with SQL tables and stored procedures in Enterprise Manager. By default, the system and stored procedures are visible along with user-defined ones which make it fairly inconvenient when you are only interested in your own tables and stored procedures.

To make life a bit easier I thought I would find a way of hiding the system objects. The instructions are as follows :

1.  Right click on the "(Local)(WindowsNT)" in the Enterprise Manager.
2.  Select "Edit SQL Server Registration Properties," which opens up a property panel.
3.  Uncheck the option "Show system databases and system obejcts."
4.  Click OK

Disable a user account using command line

Access your domain contoller and type the following format to disable your user :

dsmod user "cn=Joe Bloggs, ou=IT Admins, dc= Your Domain name , dc=com" -disabled yes

Check if user account is active using command line

Access your domain contoller and type the following format to check if the user is active :

NET USER jbloggs /DOMAIN | FIND /I "Account active"

Find the name of members within a group using command line

Access your domain contoller and type the following format to find the members of a group :

dsget group "cn=IT guys, ou=IT admins, dc= Your Domain name , dc=com" -members

How to see what files are currently open on a network

Sometimes a user may leave a files open on their PC and go away from their desk, leaving the document locked and uneditable for other users.

The solution is to disconnect that user from the file and allow the new user to open it and perform the tasks that are necessary.

To locate these folders and perform this action do the following :

- Access the server that holds your network shares
- Start>Programs>Administrative tools>Computer Managment
- Expand 'Shared Folders' and select 'Open Files'
- Highlight the file in question>Right click and select 'Close Open File' from the menu

Please note that this will not close the file on the users PC it just closes the connection to the network.

Add a user in Active Directory using command line

Access your domain contoller and type the following format to add your user :

dsadd user "cn=Joe Bloggs, ou=IT Admins, dc= Your Domain name , dc=com" -samid joebloggs -upn info@YourDomain.com -fn Joe -ln Bloggs -display "Joe Bloggs" -pwd Pa$$w0rd -desc "Systems Administrator"

*ou = is the name of Organisational Unit you will be adding the user to.

How to show system folders that are hidden within Microsoft WindowsXP & Server

By default, system folders within Microsoft Windows XP and Microsoft Server will be hidden. There may be instances where you will need to access these folders, and the steps are as follows :

1. Go to 'My Computer'.
2. Select 'Tools' and then 'Folder Options' from the drop down menu.
3. Go to the 'View tab'
4. Under 'Advanced settings' untick the option that says 'Hide protected operating system files (Recommended)''.
5. Click 'Apply' and click 'OK'

The folders will now be visible.

How to show the extensions of files within Microsoft Windows XP & Server

By default, within Microsoft Windows XP and Microsoft Server file extensions will be hidden i.e. if you have a text file called 'Testing' it will show as that rather than 'Testing.txt'. In order to show these file extensions do the following :

1. Go to 'My Computer'.
2. Select 'Tools' and then 'Folder Options' from the drop down menu.
3. Go to the 'View tab'
4. Under 'Advanced settings' untick the option that says 'Hide extensions for known file types'.
5. Click 'Apply' and click 'OK'

How to start and stop a service using command line

This method of starting and stopping a service applies to all Windows based operating systems e.g. Windows 2000, XP, Vista and Windows Server 2000/2003.

The first thing you will have to know is the name of the service you want to stop or start. You can find this by going to the services list :

1.Winkey + r
2. Type 'services.msc'
3. Locate the service you wish to start/stop and righ click>properties
4. The Service name is shown at the top on the general tab.

For my example i am going to use Internet Information Server (IIS) as the service i wish to stop. It's service name is 'w3svc'. So once you have the name then perform the following :

1. Winkey + r (or start menu and then click 'Run')
2. Type 'cmd' and press enter to bring up a command prompt.
3. Type Net Start or Net Stop (depending on what action you wish to perform) and then the service name e.g. 'Net stop w3svc'. Press enter.
4. In the above instance the command prompt window would show the messages "The World Wide Web Publishing service is stopping." and "The World Wide Web Publishing service was stopped successfully".

So, to start the service back up i would just use the Net start command.

Saturday, 26 September 2009

How to add a shortcut to the start menu for a commonly used application

Go to Start Menu>All Programs>Right click the application you want to add and select 'Pin to start menu' from the list.

An icon for the application will now appear in the top portion of your start menu !

Display hidden files and folders on your PC

Windows XP

Go to My Computer>Tools>Folder Options>View tab and put a marker next to 'Show hidden files and folders.

Windows Vista

Go to Computer>Tools>Folder Options>View tab and put a marker next to 'Show hidden files and folders.

How to see the names of all computers on your network with a single command

Open up a command window i.e. Winkey + R and type 'cmd' into the field and press Enter.
Type : Net View and press Enter