Showing results for 
Search instead for 
Did you mean: 
Create Post

The Basics of PowerShell (part 1)

Level 15

Ok, you're not a programmer, you're a SysAdmin. Your job is to keep things up and running. When something goes down, you need to figure out why so you can get it back up ASAP. With PowerShell at your fingertips, you can accomplish this and become a hero at the same time.

What is PowerShell?

PowerShell is a command-line shell created for system administrators. PowerShell includes an interactive prompt and a scripting environment that can be used independently or in combination. It is built on top of the .NET Framework Common Language Runtime (CLR) and the .NET Framework, and accepts and returns .NET Framework objects. In English, this means you can get the information you need almost instantly using PowerShell, if you know how to ask for it.


The Cmdlet

A cmdlet is a simple command that can manipulate objects in PowerShell. Cmdlets have a unique format -- a verb and noun separated by a dash (-), such as Get-Help. You can use each cmdlet separately or in combination to perform complex tasks. PowerShell includes more than one hundred cmdlets, and you can write your own.

Things you should know about PowerShell:

  • PowerShell does not process text. Instead, it processes objects based on the .NET Framework.
  • PowerShell comes with a set of built-in commands with a consistent interface.

PowerShell and SAM: Configuration and Usage

The ability to employ PowerShell scripts within SAM is a powerful advantage for system administrators. In order to use PowerShell with SAM you must have PowerShell 2.0 or later installed on the main Orion server and target servers. PowerShell 2.0 can be found here. After confirming that PowerShell is installed on the servers, ensure that Windows Remote Management (WinRM) is properly configured and enabled on the SAM and target servers. To do this, follow these steps:

1. On the SAM server, open a command prompt as an Administrator. To do this, go to the Start menu and right-click the Cmd.exe and then select Run as Administrator.

2. Enter the following in the command prompt:

    winrm quickconfig –q
    winrm set winrm/config/client @{TrustedHosts="*"}

3. On the target server, open a command prompt as an Administrator and enter the following commands, where IP address is the IP address of your SAM server.:

    winrm quickconfig
    winrm set winrm/config/client @{TrustedHosts="IP_ADDRESS"}

After you successfully complete these steps, PowerShell will be able to properly communicate with SAM. See Configuring and Integrating PowerShell.

In part 2, we'll discuss PowerShell Templates and Monitors.

BTW, check out the new...



Level 15

Power Shell!  Power Shell!  Power Shell!

Level 12

I am trying to get a hang of using the power shell.  cmd still gives me what i want but there are some applications that have tied to PS and from there only can commands be run. GUI GUI GUI is the easiest thing i believe. lol

Level 12

useful information

Level 10

Interesting. Very Interesting. I had idly speculated that it might be possible to use PowerShell from within NCM scripts, and indeed it seems to be possible. So many technologies, so little time.

About the Author
Who am I? • I met Robert Frost at the end of the road less traveled, and then pointed him in the right direction. • Einstein asked me to define "Up," and I did. • I cliff dive from airplanes. • On Christmas, Santa comes to me for gifts. • I play three-cushion billiards with one hand. • Lions ask for my protection (I speak Lion). • Bobby Fischer and I came to a stalemate while playing chess. • I have literally given a woman the shirt off of my back. • I have also helped an old lady cross the street. • I know what a dangling participle is. • Mozart bequeathed his Requiem to me, and I corrected it. • I was thrown out of an Eric Clapton concert twice in the same night for drawing too much attention to myself. • I am a verbose minimalist. • I am Bronx. Who are you?