September, 2013

now browsing by month

 

Enable / Disable firewall via command line

Please refer to link: http://social.technet.microsoft.com/Forums/windowsserver/en-US/5a438757-d294-483d-8619-df9eb5700561/how-to-disable-the-windows-firewall-using-the-command-shell

netsh firewall set opmode disable

As Zaubi points out you should avoid using this command because it eliminates the firewall as a security measure completely, which is a bad thing. Temporarily disabling the firewall might be useful to troubleshoot network connectivity. The command to enable the firewall again is:

netsh firewall set opmode enable

Firewall

I recommend taking a look at one of the command lines below. I’ll show you some examples of how to open up the firewall.I assume you use the Windows Firewall in the Default profile.

 

To enable service exceptions

The Windows Firewall in a Server Core installation of Windows Server 2008 comes with a couple of default firewall exceptions. You can enable these exception to allow specific types of traffic through the firewall. For example, to allow File and Printer Sharing you can run the following command:

netsh firewall set service fileandprint

If at any point you need help with the set service command just type netsh firewall set servicewhich will show you some help. Extra command line switches may allow you to specify another firewall profile and/or specify a firewall scope (all, subnet or custom)

To open specific ports

If your situation demands you open up specific ports to allow incoming traffic through your firewall you can add specific port openings in your firewall. You can specify whether the traffic is UDP or TCP, which port number you’d like to open and which name you’d like to give your portopening, like this:

netsh firewall set portopening protocol=TCP | UDP port=PortnumberHerename=AnyNameHere

If at any point you need help with the set service command just type netsh firewall set portopening which will show you some help. Extra command line switches may allow you to specify another firewall profile and/or specify a firewall scope (all, subnet or custom)

To allow specific programs

Another way to open up the firewall is to allow specific programs to communicate with the outside world. The Windows Firewall will allow any traffic to the executables you specify. Again you can also specify a name for the rule. Use this command to allow specific programs:

netsh firewall set allowedprogram program=FullPathToExecutable name=AnyNameHere

If at any point you need help with the set service command just type netsh firewall set allowedprogram which will show you some help. Extra command line switches may allow you to specify another firewall profile and/or specify a firewall scope (all, subnet or custom)

 Advanced Firewall

Alternatively you can use the spanking new Advanced Firewall, which enables you to control incoming as well as outgoing traffic, allows you to edit the firewall configuration in offline mode (so you can change the settings, without committing any changes yet) There’s a nice webpage with more information on the Advanced Firewall functionality here. It shows you how to change settings through the commandline and how to change them using Group Policies.

Under Windows XP SP2, it is possible to enable or disable the firewall with the following command lines.

First open the command prompt: (Windows + R keys) and type : cmd

GET SYSTEM INFORMATION FROM COMMAND LINE USING SYSTEMINFO COMMAND

Refer to link: http://windowscmdline.blogspot.co.il

Get System information from command line using Systeminfo command

We can find system information of a computer from windows command line using the commandSysteminfo. This command shows the following details.
Computer name, OS version, OS configuration, OS type, Install Date, System uptime data, BIOS version, Available physical memory, Processor model, Hotfixes installed, Network cards information, 
Domain name of the computer, System Locale, Time Zone and many other details.
Since systeminfo shows us lots of information, if we want to get any particular information we can usefindstr command to filter out unwanted details. See some examples below.
To get system’s physical memory information from windows command line:
systeminfo | findstr /C:”Total Physical Memory”
To get System type from windows command line:
systeminfo | findstr /C:”System type”
To find System locale from windows command line:
systeminfo | findstr /C:”System Locale”
To find system manufacturer from windows command line:
systeminfo | findstr /C:”System Manufacturer”
To find OS install date from windows command line:
systeminfo | findstr /C:”Install Date”

NET LOCALGROUP from COMMAND

Refer to link: http://windowscmdline.blogspot.co.il/

NET LOCALGROUP

Net localgroup command can be used to manage local user groups on a computer. Using this command, administrators can add users to groups, delete users from groups, create new groups and delete existing groups. Below you can find syntax for all these operations.
Create a new local group
We can use below command to create a new local group.
net localgroup /add groupname
Example:
Command for adding a new user group ‘testgroup’
net localgroup /add testgroup
List the user groups on the local computer
‘net localgroup‘ command displays the list of user groups on the local computer.
Example:
c:>net localgroup
Aliases for \WINCMD-PC
——————————————————————————-
*Administrators
*Backup Operators
*Power Users
*Remote Desktop Users
*Replicator
*testgrp
*Users
Some of the groups listed above, are created by default with Windows installation.
Add a user to group
Below is the syntax for adding a user to a local group.
net localgroup groupname username /add
For example, to add user ‘user1′ to the group ‘testgrp’ the command is:
net localgroup testgrp user1 /add
List the users that belong to a group
‘net localgroup groupname‘ prints the list of users in a group.
Example:
c:>net localgroup testgrp
Alias name     testgrp
Comment
Members
——————————————————————————-
test
The command completed successfully.
Delete user from group
Below is the command for deleting a user from a group.
net localgroup groupname username /delete
To delete user ‘user1′ from the group ‘testgrp’ the command is:
net localgroup testgrp user1 /delete
All the above commands should be run from elevated administrator command prompt in Vista and Windows 7. Other wise an error will be generated as shown below.
C:>net localgroup /add test1
System error 5 has occurred.
Access is denied.

ADD USER TO GROUP FROM COMMAND LINE (CMD)

Refer to link: http://windowscmdline.blogspot.co.il/

Add user to group from command line (CMD)

In Windows computer we can add users to a group from command line. We can use net localgroupcommand for this.

net localgroup group_name UserLoginName /add

For example to add a user to administrators group, we can run the below command. In the below example I have taken username as John.

net localgroup administrators Miller /add

Few more examples:
To add a domain user to local users group:

net localgroup users domainnameusername /add

This command should be run when the computer is connected to the network. Otherwise you will get the below error.

H:>net localgroup users domainuser /add
System error 1789 has occurred.
The trust relationship between this workstation and the primary domain failed.

To add a domain user to local administrator group:

net localgroup administrators domainnameusername /add

To add a user to remote desktop users group:

net localgroup "Remote Desktop Users" UserLoginName  /add

To add a user to debugger  users group: 

net localgroup "Debugger users" UserLoginName /add

To add a user to Power users group: 

net localgroup "Power users" UserLoginName /add

This command works on all editions of Windows OS i.e. Windows 2000, Windows XP, Windows Server 2003, Windows Vista and Windows 7. In Vista and Windows 7, even if you run the above command from administrator login you may still get access denied error like below.

C:> net localgroup administrators techblogger /add
System error 5 has occurred.
Access is denied.

The solution for this is to run the command from elevated administrator account. See How to open elevated administrator command prompt

When you run the ‘net localgroup’ command from elevated command prompt:

C:>net localgroup administrators techblogger /add
The command completed successfully.

To list the users belonging to a particular group we can run the below command.

net localgroup group_name

For example to list all the users belonging to administrators group we need to run the below command.

net localgroup administrators

ENABLE REMOTE DESKTOP FROM COMMAND LINE (CMD)

Enable remote desktop from command line (CMD)

Remote desktop can be enabled/disabled by opening My computer properties and then by changing the settings in the ‘Remote‘ tab. We can do the same by editing registry key settings. This is explained below. Remote desktop is also called Terminal services or TS or RDP. This is an in-built remote desktop software for Windows users.
To enable remote desktop.
  • Open registry editor by running regedit from Run.
  • Go to the node HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server
  • Change the data of the value fDenyTSConnections to 0.
We can enable remote desktop from windows command line by running the following command.
reg add “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f
To disable remote desktop we need to run the below command.
reg add “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server” /v fDenyTSConnections /t REG_DWORD /d 1 /f
Reboot or logoff is not required after running the above command. I have tested this on Windows XP and Windows 7 and it has worked fine. It would work fine on Windows Vista too.
To enable Remote assistance:
reg add “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server” /v fAllowToGetHelp /t REG_DWORD /d 1 /f
Then add a user to Remote Desktop access:
net localgroup “Remote Desktop Users” USER /ADD

Create an administrator account using the command prompt

You can create an account using the command prompt (no administrator privileges needed!) just by entering the following code into cmd:

net user NAME /ADD

Just replace NAME with the name of the account and you are ready to go!

However, having an account is no fun unless you are the Administrator! So, just enter the following code into cmd and you can make anyone an admin!

net localgroup Administrator NAME /ADD

Just replace NAME with your account name.

Note: depending on the way your computer is set up, you might have to either type Administrator, Administrators or Admin after localgroup.

Now, what if you want to give that account (or any other account) a new password? Just type:

net user NAME *

Then when the enter password thing pops up just type in the password that you want, reenter it and then press enter! Done!

Now, when your fun is all done and you want to delete your account that you created, just enter:

Net user NAME /DELETE

This will delete all the user’s files as well, so beware when deleting an account!

To reset a password:

Net user NAME PASSWORD
or
Net user Name * (then you will be prompted to enter a password)

Install Google Cloud Print

 

Connect your classic printers with Google Cloud Print

If your printer is Cloud Ready, follow your manufacturer’s provided instructions or seesetting up your Cloud Ready printer.

To connect your classic printer, enable the Google Cloud Print connector on any (non-Chrome OS) computer that is already connected to your printer and able to print. You’ll need Google Chrome to be installed on the computer. If you’re using Windows XP, make sure you also have the Windows XP Service Pack 3 (SP3) installed.

Once Google Chrome is installed, follow the steps below to enable the Google Cloud Print connector in Google Chrome.

  1. Log in to your user account on the Windows, Mac, or Linux computer.
  2. Open Google Chrome.
  3. Click the Chrome menu Chrome menu on the browser toolbar.
  4. Select Settings.
  5. Click the Show advanced settings link.
  6. Scroll down to the “Google Cloud Print” section. Click Sign in to Google Cloud PrintSign in to Google Cloud Print
  7. In the window that appears, sign in with your Google Account to enable the Google Cloud Print connector.
  8. Select the printers you want to connect, and then click Add printer(s).
  9. You’ll see a confirmation that Google Cloud Print has been enabled. Click Manage your printers to learn more.

The printer is now associated with your Google Account and connected to Google Cloud Print. You can print to this printer using Google Cloud Print whenever you’re signed in with the same Google Account.

Run Google Cloud Print as a Windows Service

This article is for IT administrators setting up Google Cloud Print on their Windows print servers. If you’re new to Cloud Print, see the Cloud Print for Business Overview.

Set up Google Cloud Print for your Organization

If you’re using a Windows Print server, you can download and run Google Cloud Print as a Windows Service on your server. This will allow users in your organization to print to your organization’s legacy printers from Chrome devices and other web-enabled devices. This is the same as using Google Cloud Print Connector, but running it as a service means that Cloud Print will be always on–running on your organization’s servers. It can be used in parallel with your current print solution.

Install Google Cloud Print

  1. Install Chrome 27+ for all users. The Cloud Print service runs as different user and needs access to Chrome. Chrome should be located under %programfiles%GoogleChrome
  2. Download GCP Windows Service.
  3. From your Start menu, open Google Cloud Print Service and run it.
  4. In the Windows prompt that appears, enter your Windows administrator username and password.
  5. Click Register.
  6. In the Chrome window that appears, sign in to your Google Apps account.
  7. Click Add Printers and don’t close the browser. It will be closed automatically by the config utility. (You can close the popup if it’s still open.) The “State:” field should switch to “Running”.
  8. Verify that the expected printers are available in the management page.

Requirements

  • At least some of your business’ printers are not Google Cloud Print Ready
  • You have a Windows print server or other Windows machine that is on around the clock that you’d like to use for print job routing.

Supported Platforms

  • Windows 8, 64bit
  • Windows 7, 32/64bit
  • Windows Server 2008 and 2012, 64bit
  • Windows Server 2003, 32bit (only with Microsoft XML Paper Specification Essentials Pack)
  • Windows XP with SP 3, 32bit (only with Microsoft XML Paper Specification Essentials Pack)
Note: Windows XP and Server 2003 will no longer be supported after the Windows XP End of Supportdate (April 8, 2014).

Uninstall

Open your Control Panel in Windows and uninstall Google Cloud Print Service.

Troubleshooting

  • You can start, stop, register, and unregister the service using config utility from step 2 of setup.
  • You can enabling logging during service registration. Logs will be available at “C:Users<USER>AppDataLocalGoogleCloud Print Servicechrome_debug.log” (for Windows 7)

Resources

Then refer to link:

https://tools.google.com/dlpage/cloudprintdriver

Print anywhere, from any application

Install Cloud Printer

^