Search This Blog

Tuesday, January 3, 2017

10 PowerShell commands every Windows admin should know

PowerShell combines the speed of the command line with the flexibility of a scripting language, making it a valuable Windows administration tool. Here are a few basic commands you'll want to master.

From the link: http://www.techrepublic.com/blog/10-things/10-powershell-commands-every-windows-admin-should-know/
Over the last few years, Microsoft has been trying to make PowerShell the management tool of choice. Almost all the newer Microsoft server products require PowerShell, and there are lots of management tasks that can't be accomplished without delving into the command line. As a Windows administrator, you need to be familiar with the basics of using PowerShell. Here are 10 commands to get you started.
Note: This article is also available as a PDF download.

1: Get-Help

The first PowerShell cmdlet every administrator should learn is Get-Help. You can use this command to get help with any other command. For example, if you want to know how the Get-Process command works, you can type:
Get-Help -Name Get-Process
and Windows will display the full command syntax.
You can also use Get-Help with individual nouns and verbs. For example, to find out all the commands you can use with the Get verb, type:
Get-Help -Name Get-*

2: Set-ExecutionPolicy

Although you can create and execute PowerShell scripts, Microsoft has disabled scripting by default in an effort to prevent malicious code from executing in a PowerShell environment. You can use the Set-ExecutionPolicy command to control the level of security surrounding PowerShell scripts. Four levels of security are available to you:
  • Restricted — Restricted is the default execution policy and locks PowerShell down so that commands can be entered only interactively. PowerShell scripts are not allowed to run.
  • All Signed — If the execution policy is set to All Signed then scripts will be allowed to run, but only if they are signed by a trusted publisher.
  • Remote Signed — If the execution policy is set to Remote Signed, any PowerShell scripts that have been locally created will be allowed to run. Scripts created remotely are allowed to run only if they are signed by a trusted publisher.
  • Unrestricted — As the name implies, Unrestricted removes all restrictions from the execution policy.
You can set an execution policy by entering the Set-ExecutionPolicy command followed by the name of the policy. For example, if you wanted to allow scripts to run in an unrestricted manner you could type:
Set-ExecutionPolicy Unrestricted

3: Get-ExecutionPolicy

If you're working on an unfamiliar server, you'll need to know what execution policy is in use before you attempt to run a script. You can find out by using the Get-ExecutionPolicy command.

4: Get-Service

The Get-Service command provides a list of all of the services that are installed on the system. If you are interested in a specific service you can append the -Name switch and the name of the service (wildcards are permitted) When you do, Windows will show you the service's state.

5: ConvertTo-HTML

PowerShell can provide a wealth of information about the system, but sometimes you need to do more than just view the information onscreen. Sometimes, it's helpful to create a report you can send to someone. One way of accomplishing this is by using the ConvertTo-HTML command.
To use this command, simply pipe the output from another command into the ConvertTo-HTML command. You will have to use the -Property switch to control which output properties are included in the HTML file and you will have to provide a filename.
To see how this command might be used, think back to the previous section, where we typed Get-Service to create a list of every service that's installed on the system. Now imagine that you want to create an HTML report that lists the name of each service along with its status (regardless of whether the service is running). To do so, you could use the following command:
Get-Service | ConvertTo-HTML -Property Name, Status > C:\services.htm

6: Export-CSV

Just as you can create an HTML report based on PowerShell data, you can also export data from PowerShell into a CSV file that you can open using Microsoft Excel. The syntax is similar to that of converting a command's output to HTML. At a minimum, you must provide an output filename. For example, to export the list of system services to a CSV file, you could use the following command:
Get-Service | Export-CSV c:\service.csv

7: Select-Object

If you tried using the command above, you know that there were numerous properties included in the CSV file. It's often helpful to narrow things down by including only the properties you are really interested in. This is where the Select-Object command comes into play. The Select-Object command allows you to specify specific properties for inclusion. For example, to create a CSV file containing the name of each system service and its status, you could use the following command:
Get-Service | Select-Object Name, Status | Export-CSV c:\service.csv

8: Get-EventLog

You can actually use PowerShell to parse your computer's event logs. There are several parameters available, but you can try out the command by simply providing the -Log switch followed by the name of the log file. For example, to see the Application log, you could use the following command:
Get-EventLog -Log "Application"
Of course, you would rarely use this command in the real world. You're more likely to use other commands to filter the output and dump it to a CSV or an HTML file.

9: Get-Process

Just as you can use the Get-Service command to display a list of all of the system services, you can use the Get-Process command to display a list of all of the processes that are currently running on the system.

10: Stop-Process

Sometimes, a process will freeze up. When this happens, you can use the Get-Process command to get the name or the process ID for the process that has stopped responding. You can then terminate the process by using the Stop-Process command. You can terminate a process based on its name or on its process ID. For example, you could terminate Notepad by using one of the following commands:
Stop-Process -Name notepad

Stop-Process -ID 2668
Keep in mind that the process ID may change from session to session.

10 PowerShell commands to make remote management easier

These 10 PowerShell commands will come in handy when you need to remotely manage computers on a domain or workgroup.

From the link: http://www.techrepublic.com/article/10-powershell-commands-to-make-remote-management-easier/

So without further ado, let's review the requirements necessary to get the most out of PowerShell's awesome features. Then we'll focus on 10 commands that will make life easier by managing devices and services on your network remotely and more efficiently.

Computer running Windows Vista (or higher)Requirements

  • Server running Windows Server 2008 (or higher)
  • PowerShell 5.0
  • Administrative access

1: Create a PowerShell session

Command: Enter-PSSession
Example: Enter-PSSession -ComputerName REMOTE_COMPUTER_NAME -Credential USERNAME

Figure A

Creating a PSSession will allow an administrator to remotely connect to a computer on the network and run any number of PS commands on the device. During the session, multiple commands may be executed remotely, since the admin has console access just as though he/she were sitting locally at the machine.

Figure B


Figure C

2: Execute commands

Command: Invoke-Command
Example: Invoke-Command -Computer REMOTE_COMPUTER_NAME -ScriptBlock {PowerShell Command}

Figure D

Using Invoke-Command in PS renders similar results to executing a session as in command #1 above, except that when using Invoke to call forth a command remotely, only one command may be executed at a time. This prevents running multiple commands together unless they are saved as a .PS1 file and the script itself is invoked.

3: Restart computer(s)

Command: Restart-Computer
Example: Restart-Computer -ComputerName REMOTE_COMPUTER_NAME -Force

Figure E

Sometimes installations or configurations will require a reboot to work properly. Other times, a computer just needs a refreshing of the resources, and a reboot will accomplish that. Whether targeted at one or one hundred devices, PS can ease the job with just one command for all.

4: Ping computer(s)

Command: Test-Connection
Example: Test-Connection -ComputerName DESTINATION_COMPUTER_NAME -Source SOURCE_COMPUTER_NAME

Figure F

The PING command is one of the most useful commands in a sysadmin's arsenal. Simply put, it tests connectivity between your current station and another remote system. Test-Connection brings it up a notch by folding that functionality into a PS cmdlet, while adding some new tricks—such as being able to designate a source computer that's different from the one you're currently logged onto. Say you need to test communications between a server and a remote device. The ICMP requests will be sent from the server to the remote device, yet report the findings back to your admin station.

5: View and modify services

Command: Set-Service
Example: Set-Service -ComputerName REMOTE_COMPUTER_NAME -Name SERVICE_NAME -Status SERVICE_STATUS

Figure G

Services are resilient and sometimes finicky. Depending on what's going on with a particular computer, they may halt at the worst possible time. Determining a station's running services begins with the Get-Service cmdlet to obtain current statuses. Once that information is available, the process to set a service status is possible - be it for one service, those that begin with the letter W, or all of them at once.

Figure H

6: Run background tasks

Command: Start-Job
Example: Start-Job -FilePath PATH_TO_SCRIPT.PS1

Figure I

Some administrators do what they need to do when they need to do it, regardless of what's going on or what the users are doing. Others prefer to work in the shadows to keep things humming along with little to no interruptions. If you're one of the latter, this cmdlet is perfect for your management style.
It executes scripts or tasks in the background no matter who is interactively logged on or what they may be doing. Further, it will execute silently—even if it were to fail—and not interrupt the locally logged on user at all. Like a ghost!

7: Shut down computer(s)

Command: Stop-Computer
Example: Stop-Computer -ComputerName REMOTE_COMPUTER_NAME -Force

Figure J

Unlike running things silently or rebooting a desktop from afar, there are times when computers need to be shut down. For these moments, this cmdlet will ensure that one or all computers are properly shut down and will even log off interactive users if the -Force argument is included.

8: Join computers to a domain

Command: Add-Computer
Example: Add-Computer -ComputerName COMPUTER_NAMES_TO_BE_JOINED -DomainName DOMAIN.COM -Credential DOMAIN\USER -Restart

Figure K

While the process of joining a computer to a domain is fairly straightforward, the three clicks and entering of admin credentials can become quite tedious when multiplied by several hundreds of computers at a time.
PowerShell can make short work of the task. This cmdlet allows for multiple computers at once to be joined to a domain, while requiring the admin to enter his/her credentials only once.

9: Manage other applications and services

Command: Import-Module
Example: Import-Module -Name NAME_OF_POWERSHELL_MODULE

Figure L

One of PowerShell's greatest benefits is its flexibility when it comes to managing just about anything—from Windows-based computing systems to applications like Microsoft Exchange. Some applications and system-level services permit only a certain level of management via GUI. The rest is defaulted to PS, so Microsoft is clearly leveraging the technology significantly.
This is accomplished through the use of modules that contain the necessary codebase to run any number of additional cmdlets within PowerShell that target a specific service or application. Modules may be used only when needed by importing them, at which point they will extend the PS functionality to a specific service or app. Once your work is done, you can remove the module from the active session without closing it altogether.

10: Rename computers

Command: Rename-Computer
Example: Rename-Computer -NewName NEW_COMPUTER_NAME -LocalCredential COMPUTERNAME\USER -Restart

Figure M

Depending on several factors, including the deployment system used, scripting experience level and security, and company policy, computers being renamed might not be done regularly (or perhaps it's a task performed quite often). Either way, the Rename cmdlet is extremely useful when working on one or multiple systems—workgroup or on a domain.
The cmdlet will rename a device and reboot it so that the changes can take effect. For those on a domain, the added benefit will be that if the Active Directory Schema supports it, the new computer will also result in a computer object rename within AD. The object will retain all its settings and domain joined status but will reflect the new name without any significant downtime to the user outside of a reboot.

Saturday, August 27, 2016

VMWare: How to Change the ESXi System Time and HW Clock on the CLI

http://www.empirion.co.uk/vmware/vmware-how-to-change-the-system-time-on-the-cli/

This article details how to change the ESXi system time and HW clock on your ESXi hypervisor machine via the CLI.
Ideally we want to use NTP to set the system time but if your clock is too far out from the actual time then this will fail and you may see something like this in the syslog file:
ntpd[263140]: synchronized to <46 .249.47.127="">, stratum 1
ntpd[263140]: time correction of <54423> seconds exceeds sanity limit (1000); set clock manually to the correct UTC time.
[info 'ha-eventmgr'] Event 91 : NTP daemon stopped. Time correction 1206 > 1000 seconds. Manually set the time and restart ntpd.
The situation was that my VMs were synchronising their time to the ESXi host’s on every reboot, meaning that some important secure system services (in Windows 2008 in particular) were not starting. There isn’t the facility to do this on the DCUI (Direct Console User Interface – the yellow and black screen) so here’s the gen on how to achieve this using the command line.
My first endeavours were using the “date” command, as I’m used to doing in Linux, unfortunately these were met with the error:
~ # date 100410112014
date: can't set date: Function not implemented
Sat Oct  4 10:11:00 UTC 2014
OK, it’s being pernickety so lets use the “-s” flag to SET the time:
~ # date -s 041010112014
date: Setting date not supported; use
Now we’re getting somewhere. The command takes the following parameters:
Usage: esxcli system time set [cmd options]
Description:
set                   Set the system clock time. Any missing parameters will default to the current time

Cmd options:
-d|--day=       Day
-H|--hour=      Hour
-m|--min=       Minute
-M|--month=     Month
-s|--sec=       Second
-y|--year=      Year
So, to set the system time to 10th April 2014, 10:18 (am):
~ # esxcli system time set -d 10 -H 10 -m 18 -M 04 -y 2014
Also, make sure that we also set the hardware clock time as the system time will revert to this on a reboot:
~ # esxcli hardware clock set -d 10 -H 10 -m 18 -M 04 -y 2014     <- 10:18="" 10th="" 2014="" am="" april="" clock="" code="" hardware="" sets="" the="" to="">
To check the hardware and system time we can use the following commands:
esxcli hardware clock get
esxcli system time get

Saturday, August 6, 2016

5 DNS Services to Block Porn Sites without Installing Software

https://www.raymond.cc/blog/how-to-block-pornographic-websites-without-spending-money-on-software/

The Internet is so vast and uncensored that it is capable of plaguing the young minds if the parents do not play their role in making sure that the bad websites are being filtered and blocked. Unlike previous generations where they probably hide their adult magazines under their bed, all they need is a device such as smartphone, tablet or desktop computer with an Internet connection to access the hundreds of thousands freely available porn sites by clicking the “I Agree” button to comply with the displayed conditions.
We have previously introduced 10 parental control software that you can install on your Windows computer to automatically detect bad websites and block them. They are effective but most of them can be easily tampered and bypassed. On this article we will be introducing the DNS method that can be used as an additional filtering system to block out bad websites and it works perfectly with the parental control software.
Basically a DNS is used to translate a typed URL (www.raymond.cc) into an IP address (142.4.51.106), and it works very quickly behind the scenes. When you connect to the Internet, Windows will by default use the DNS server provided by your ISP unless you’ve manually changed it to a different one such as Google Public DNS. Fortunately, we have found 3 free DNS services that come with protection policies to block porn and other types of unsavory websites. 1. OpenDNS FamilyShield
OpenDNS FamilyShield
OpenDNS was one of the very first to offer a public DNS service for free with the ability to block adult websites. Previously the configuration was a pain especially for users with dynamic IP address because it requires signing up an account, setting up the filtering and then installing an updater client so that the IP address is up to date. OpenDNS have come up with a new service called FamilyShield where it is pre-configured to block pornography websites by using their DNS servers.
Preferred DNS Server: 208.67.222.123
Alternate DNS Server: 208.67.220.123
OpenDNS still offers the classic service called OpenDNS Home where you get to customize the filtering by choosing the categories that you want to allow or block and also adding individual domains to whitelist or blacklist.

2. Norton ConnectSafe
Norton ConnectSafe
Also known as Norton DNS, Norton ConnectSafe offers 3 different protection policies for free with different IP addresses. The first one is for security to block out malware, phishing and scam sites, while the second one adds the ability to block porn to the list and the last one adds non-family friendly sites such as drugs, gambling, crime, etc.
Security
Preferred DNS Server: 198.153.192.40
Alternate DNS Server: 198.153.194.40
Security + Pornography
Preferred DNS Server: 198.153.192.50
Alternate DNS Server: 198.153.194.50
Security + Pornography + Non-Family Friendly
Preferred DNS Server: 198.153.192.60
Alternate DNS Server: 198.153.194.60

3. MetaCert DNS
MetaCert DNS
MetaCert is well known for their plugin for Firefox and Chrome to protect your children from pornography. They are currently venturing in the DNS service where it has more flexibility to work on more devices rather than from just web browsers. Do note that currently MetaCert DNS is still in beta and they only have one DNS server. During testing we found that MetaCert DNS filtering fails periodically.
Preferred DNS Server: 184.169.223.35
On the next page there are another 2 family friendly DNS services and a utility you can use to try out some of these services with the click of a button.
4. SafeDNS
safedns
SafeDNS is a relatively new DNS service that concentrates on be able to block porn and a range of other unsavory websites such as violence, alcohol & smoking by default. If you sign up for a free account you can setup filtering for over 50 different categories containing around 5 million websites, configure exceptions and also view your DNS usage history. A Windows tool called SafeDNS Agent is also available to control all of the SafeDNS service options from the desktop.
Primary DNS server: 195.46.39.39
Secondary DNS Server: 195.46.39.40

5. SentryDNS
SentryDNS
The free SentryDNS service is able to provide limited content filtering and can block a number of websites in addition to pornography, including malware, phishing, botnets and illegal downloads. Optionally signing up to the service will allow you to control web filtering from different categories. A companion tool called SentryDNS WAN Agent will watch your WAN IP address and notify the SentryDNS service of any changes when they occur, a useful option for dynamic IP users.
Primary DNS Server: 152.160.81.10
Secondary DNS Server:  70.90.33.94

Try Out 3 of these DNS Services Using a Simple Program
The problem when you have a choice of services is you maybe can’t decide which one you should use. Or perhaps changing the DNS server is not something you’re comfortable in doing. Well, the good news is, there’s a handy little tool around that will give you the opportunity of trying out 3 of these DNS services with just the click of a button, no manual setting up needed.
DNS Angel is basically a cut down version of a useful tool called DNS Jumper which allows you to easily try out several different DNS servers from a preset list. DNS Angel has no preset list, and instead concentrates on enabling and switching between the OpenDNS FamilyShield, MetaCert DNS and Norton ConnectSafe services just by clicking on the relevant button.
DNS Angel
Simply start the program, it’s free and portable, and it will show your current DNS which will likely be something like 192.168.1.1 etc. All you need to do is click on the button for the DNS service you want to try and then test it out in your browser, the web browser may need restarting if it’s open while changing DNS servers. You will obviously need to hide this tool on your computer so no-one else can change the DNS back to the default and enable adult website viewing again. Perhaps something like password protection might be included in a future version.

Editor’s Note: One very important information that you should know is the DNS settings in Windows will override the one on your router. For example, if you’ve configured your router to use OpenDNS FamilyShield but the computer is using the Google Public DNS, the computer will end up using the Google’s DNS rather than OpenDNS. To prevent the DNS method being bypassed, you will need to create a restricted standard user account for your children so that they cannot change the DNS settings.

Tuesday, July 26, 2016

How to remove malware from your Windows PC

http://www.computerworld.in/how-to/how-remove-malware-your-windows-pc

Clean out and restore your PC to its pristine state.

Is your computer running slower than usual? Are you getting lots of pop-ups? Have you seen other weird problems crop up? If so, your PC might be infected with a virus, spyware, or other malware—even if you have an antivirus program installed. Though other problems such as hardware issues can produce similarly annoying symptoms, it’s best to check for malware if your PC is acting up and we’ll show you how to do it yourself.

Step 1: Enter Safe Mode

Before you do anything, you need to disconnect your PC from the internet, and don’t use it until you’re ready to clean your PC. This can help prevent the malware from spreading and/or leaking your private data.
If you think your PC may have a malware infection, boot your PC into Microsoft’s Safe Mode. In this mode, only the minimum required programs and services are loaded. If any malware is set to load automatically when Windows starts, entering in this mode may prevent it from doing so. This is important because it allows the files to be removed easier since they’re not actually running or active.
Sadly, Microsoft has turned the process of booting into safe mode from a relatively easy process in Windows 7 and Windows 8 to one that is decidedly more complicated in Windows 10. To boot into Windows Safe Mode, first click the Start Button in Windows 10 and select the Power button as if you were going to reboot, but don’t click anything. Next hold down the Shift key and click Reboot. When the full-screen menu appears, select Troubleshooting, then Advanced Options, then Startup Settings. On the next window click the Restart button and wait for the next screen to appear (just stick with us here, we know this is long). Next you will see a menu with numbered startup options; select number 4, which is Safe Mode. Note that if you want to connect to any online scanners you’ll need to select option 5, which is Safe Mode with Networking.
You may find that your PC runs noticeably faster in Safe Mode. This could be a sign that your system has a malware infection, or it could mean that you have a lot of legitimate programs that normally start up alongside Windows. If your PC is outfitted with a solid state drive it’s probably fast either way.

Step 2: Delete temporary files

tempfilesYou can use Windows 10’s built-in disk cleanup utility to rid your system of unnecessary temp files. 
Now that you’re in Safe Mode, you’ll want to run a virus scan. But before you do that, delete your temporary files. Doing this may speed up the virus scanning, free up disk space, and even get rid of some malware. To use the Disk Cleanup utility included with Windows 10 just type Disk Cleanup in the search bar or after pressing the Start button and select the tool that appears named Disk Cleanup.
PC Worl

Step 3: Download malware scanners

Now you’re ready to have a malware scanner do its work—and fortunately, running a scanner is enough to remove most standard infections. If you already had an antivirus program active on your computer, you should use a different scanner for this malware check, since your current antivirus software may not have detected the malware. Remember, no antivirus program can detect 100 percent of the millions of malware types and variants.
There are two types of antivirus programs. You’re probably more familiar with real-time antivirus programs, which run in the background and constantly watch for malware. Another option is an on-demand scanner, which searches for malware infections when you open the program manually and run a scan. You should have only one real-time antivirus program installed at a time, but you can have many on-demand scanners installed to run scans with multiple programs, thereby ensuring that if one program misses something a different one might find it.
If you think your PC is infected, we recommend using an on-demand scanner first and then following up with a full scan by your real-time antivirus program. Among the free (and high-quality) on-demand scanners available are BitDefender Free Edition, Kaspersky Virus Removal Tool, Malwarebytes, Microsoft’s Malicious Software Removal Tool, Avast, and SuperAntiSpyware.

Step 4: Run a scan with Malwarebytes

For illustrative purposes, we’ll describe how to use the Malwarebytes on-demand scanner. To get started, download it. If you disconnected from the internet for safety reasons when you first suspected that you might be infected, reconnect to it so you can download, install, and update Malwarebytes; then disconnect from the internet again before you start the actual scanning. If you can’t access the internet or you can’t download Malwarebytes on the infected computer, download it on another computer, save it to a USB flash drive, and take the flash drive to the infected computer.
After downloading Malwarebytes, run the setup file and follow the wizard to install the program. Once the program opens, keep the default scan option (“Threat Scan”) selected and click the Start Scan button. It should check for updates before it runs the scan, so just make sure that happens before you proceed.
malwarebytes scanChoose Threat Scan to perform a basic analysis of your computer’s most commonly infected files.  C World

Though it offers a custom-scan option, Malwarebytes recommends that you perform the threat scan first, as that scan usually finds all of the infections anyway. Depending on your computer, the quick scan can take anywhere from 5 to 20 minutes, whereas a custom scan might take 30 to 60 minutes or more. While Malwarebytes is scanning, you can see how many files or objects the software has already scanned, and how many of those files it has identified either as being malware or as being infected by malware.
If Malwarebytes automatically disappears after it begins scanning and won’t reopen, you probably have a rootkit or other deep infection that automatically kills scanners to prevent them from removing it. Though you can try some tricks to get around this malicious technique, you might be better off reinstalling Windows after backing up your files (as discussed later), in view of the time and effort you may have to expend to beat the malware.
Once the scan is complete Malwarebytes will show you the results. If the software gives your system a clean bill of health but you still think that your system has acquired some malware, consider running a custom scan with Malwarebytes and trying the other scanners mentioned earlier. If Malwarebytes does find infections, it’ll show you what they are when the scan is complete. Click the Remove Selected button in the lower left to get rid of the specified infections. Malwarebytes may also prompt you to restart your PC in order to complete the removal process, which you should do.
malwarebytes resultsMalwarebytes presents the results of its scan and lets you remove the offending bits with one click. 
If your problems persist after you’ve run the threat scan and it has found and removed unwanted files, consider running a full scan with Malwarebytes and the other scanners mentioned earlier. If the malware appears to be gone, run a full scan with your real-time antivirus program to confirm that result.

Step 5: Fix your web browser

Malware infections can damage Windows system files and other settings. One common malware trait is to modify your web browser’s homepage to reinfect the PC, display advertisements, prevent browsing, and generally annoy you.
Before launching your web browser, check your homepage and connection settings. For Internet Explorer right-click the Windows 10 Start button and select Control Panel, then Internet Options. Find the Home Page settings in the General tab, and verify that it’s not some site you know nothing about. For Chrome, Firefox, or Edge, simply go to the setttings window of your browser to check your homepage setting.
IE Home Page SettingsMake sure that your homepage settings are correct before launching Internet Explorer. PC World PC World

Step 6: Recover your files if Windows is corrupt

If you can’t seem to remove the malware or if Windows isn’t working properly, you may have to reinstall Windows. But before wiping your hard drive, copy all of your files to an external USB or flash drive. If you check your email with a client program (such as Outlook or Windows Mail), make sure that you export your settings and messages to save them. You should also back up your device drivers with a utility such as Double Driver, in case you don’t have the driver discs anymore or don’t want to download them all again. Remember, you can’t save installed programs. Instead, you’ll have to reinstall the programs from discs or redownload them.
If Windows won’t start or work well enough to permit you to back up your files, you may create and use a Live CD, such as Hiren’s BootCD (HBCD), to access your files.
Once you have backed up everything, reinstall Windows either from the disc that came with your PC, by downloading the installation image from Microsoft, or by using your PC’s factory restore option, if it has one. For a factory restore you typically must press a certain key on the keyboard during the boot process in order for restore procedure to initialize, and your PC should tell you what key to press in the first few seconds after you turn it on. It there’s no on-screen instructions consult your manual, the manufacturer, or Google.

Keeping your PC clean

Always make sure that you have a real-time antivirus program running on your PC, and make sure this program is always up-to-date. If you don’t want to spend money on yearly subscriptions, you can choose one of the many free programs that provide adequate protection, such as Avast, AVG, Panda, or Comodo. You can read more about how to find the best antivirus program for your needs right here.
In addition to installing traditional antivirus software, you might consider using the free OpenDNS service to help block dangerous sites. And if you frequent shady sites that might infect your PC with malware, consider running your web browser in sandbox mode to prevent any downloaded malware from harming your system. Some antivirus programs, such as Comodo, offer sandboxing features, or you can obtain them through a free third-party program such as Sandboxie.
When you think that you’ve rid your PC of malware infections, double-check your online accounts, including those for your bank, email, and social networking sites. Look for suspicious activity and change your passwords—because some malware can capture your passwords.
If you have a backup system in place that automatically backs up your files or system, consider running virus scans on the backups to confirm that they didn’t inadvertently save infections. If virus scans aren’t feasible, as is the case with online systems since they usually will only scan a drive attached to your PC or just the C: drive, consider deleting your old backups and resetting the software to begin saving new backups that are hopefully free from infections.
Keep Windows, other Microsoft software, and Adobe products up-to-date. Make sure that you have Windows Update turned on and enabled to download and install updates automatically. If you’re not comfortable with this, set Windows to download the updates but let you choose when to install them.

Gain Network Printer Access

http://in.pcmag.com/networking/16810/help/gain-network-printer-access

Printers
It's not unusual for a non-administrator user to find that he or she can't print to a network printer, even though an administrator on the same system can. There are a number of possible causes, but one definitely worth checking is whether your printer installs a proprietary network port.
To find out, open the Printers and Faxes dialog box (in Windows XP) or the Printers dialog box (in Vista). Right-click on the printer name, choose Properties, and then the Ports tab. If the port description shows as anything but Standard TCP/IP Port, changing the choice to Standard TCP/IP Port may solve the problem. But make sure to note which check box was originally selected, in case you need to restore the setting.