Tag Archives: Administration

HOWTO: Know your windows licensing information

To know your windows licensing information enter the following command in the console;

slmgr.vbs /dlv

This command will throw you a pop-up with all the licensing information like product key channel and etc..

Advertisements

APPCMD: IIS Over Console

When we do remote deployment what more convenient than a console? Once I got an opportunity to remotely deploy the web application along with supporting subsystems. Therefore I need a batch file to automate the whole deployment procedure.

One of the requirement is to setup IIS with new app pool, create VD and deploy the files needed to run the website. Following is the command to manage IIS over command prompt;

APPCMD
  1. To list all existing app pool from IIS use
    APPCMD LIST APPPOOL
  2. To create a new app pool then use
    APPCMD ADD APPPOOL /NAME:<NAME_OF_APPPOOL>
  3. To create app pool with integrated pipeline use
    APPCMD ADD APPPOOL /NAME:<NAME_OF_APPPOOL> /MANAGEDPIPELINEMODE:”Integrated”
  4. To create app pool with specific .NET version, use
    APPCMD ADD APPPOOL /NAME:<NAME_OF_APPPOOL> /MANAGEDRUNTIMEVERSION:”v4.0″.
  5. In this case I am using .NET Framework 4.0
  6. To enable 32-bit dlls use the flag
    /ENABLE32BITAPPONWIN64:”true”
  7. To finally create the site,
    APPCMD ADD APP /SITE.NAME:”Default Web Site” /PATH:/<VD_NAME> /PHYSICALPATH:<PHYSICAL_PATH_TO_VD> /APPLICATIONPOOL:<APP_POOL_NAME>

 

 

Power Shell: Remote session

This is a very common activity for any system administrator to remotely connect a computer and perform the administrative tasks. PowerShell offers an excellent opportunity to do exactly the same.

To remotely connect to any computer use the below command in the PowerShell

Enter-PSSession -ComputerName XXXX -Credential YYYY

Here XXXX is the computer name or IP of the remote computer and YYYY is the user name with which you want to login. This delivers the remote PS session to the remote computer if the given computer is in TrustedHosts list of WINRM. If not Powershell throws an exception as below;

image

In that case, we need to add the remote computer to the trusted hosts of WINRM. To do that, issue the below command;

winrm s winrm/config/client '@{TrustedHosts=&quot;RemoteComputer&quot;}'

Here the “RemoteComputer” is the name or IP of the computer to which you want to connect.

image

Now execute the Enter-PSSession command to invoke a remote PS session to the remote computer.

image

Now you have the remote command shell (Power Shell)

Windchill – Folder level access restrction

Windchill provides a way to manage the user/group access to a particular folder. Below are the steps to follow to provide/deny the access to a folder.

  1. Create an ACL with desired access permissions from policy administration.
  2. Go to the folder where the access restrictions should be applied and right click on the name
  3. Select “Edit” and uncheck the “Inherit domain from parent
  4. Click on find and select the ACL from the pop-up and click on OK
  5. Click on OK on “Edit Folder” pop-up

This applies the ACL to the folder.

ConEMU, A better way for console management in Windows

For server administrators and deep dive developers console is a vital helper. Some times it is very hard to maintain more than two consoles on the screens. Since they consume a good amount of real-estate on the desktop, it is very hard when you want to run background scripts or self-host WCF applications. The good news is there are few alternatives to default console on the Windows desktop or server. I am regularly using one of them and following lines are some brief account on it.

ConEMU

ConEMU is a short form from Console Emulator. This is really a versatile emulator where you can run multiple console application in tabs.

image

You can add your own console applications as tasks in this emulator. Once you added, they are available right on the screen to kick off. Also you can run any of the console application as Administrator.

image

I normally run, default console, admin console, FAR Manager and SQL Plus for my oracle database concurrently for my regular operations.

image

Another useful feature is, you can copy and command output on this console by just selecting the lines. Once you release the mouse, the selected lines will be placed into clipboard and ready to past anywhere you want.

You can download ConEMU from here.

I will update this post with details about different tasks that we can do this this console emulator.