Starting,Stopping and Restarting Remote Services with PowerShell

Learn Powershell | Achieve More

A common task that a System Administrator might face in their day is restarting a service on a remote system. While this can be accomplish using the Services.MSC or another various GUI, you have to load the GUI, then connect to the remote system, locate the service and finally perform the action on the service.

There are a few ways that this can be done using WMI (Win32_Services) and using Get-Service along with Stop/Start/Restart-Service cmdlets.

Using WMI

The first method of managing a service that I will go into is using WMI to accomplish this task. First I will connect to the specific service that I want to manipulate, in this case, the windows update client service: wuauserv.

$service = Get-WmiObject -ComputerName DC1 -Class Win32_Service `
-Filter "Name='wuauserv'"
$service

image

We now have our WMI service object for wuauserv. Lets take a look at all of the available methods for…

View original post 721 more words

Advertisements

PowerShell Cheat Sheet

rambling cookie monster

March 2015 EDIT:  Updated list of resources is available here.

I’m working on compiling a cheat sheet or two for PowerShell.  Why would I do this when so many exist?  No idea.  Is it messy and might it overlook important details?  Absolutely!  If you have any suggestions they would be greatly appreciated.

I would like to acknowledge the following sources which came in quite handy when putting the cheat sheets together.  If you haven’t already, you may want to bookmark/download/purchase these!  They will come in handy regardless of the cheat sheets you use or commands you memorize

View original post 132 more words

ASP.NET–What is ISAPI ?/What is CGI?/ Advantage Of ISAPI Over CGI

Microsoft Mentalist

    * What is CGI?

It is a gateway for transferring information between a World Wide Web server and a CGI program.

A CGI program is any program designed to accept and return data that conforms to the CGI specification. The program could be written in any programming language, including C, Perl, Java, or Visual Basic or ASP.NET.

CGI programs are the most common way for Web servers to interact dynamically with users. Many HTML pages that contain forms, for example, use a CGI program to process the form’s data once it’s submitted. Another increasingly common way to provide dynamic feedback for Web users is to include scripts or programs that run on the user’s machine rather than the Web server. These programs can be Java applets, Java scripts, or ActiveX controls. These technologies are known collectively as client-side solutions, while the use of CGI is a server-side solution because the…

View original post 141 more words

Excellent Article on the Concepts behind C# 3.0

Andrew Matthews

Thomas Petricek has written a very interesting article on the new concepts behind C# 3.0 (here). It shows the origin of many of the functional programming features found in C# 3.0 from and F#. Having explored a little of the code that backs up the functional programming aspects, I understand that although the extension run with the basic features of C# 2.0, there is a huge amount of C# code required to deliver the functional paradigm to C#. Most of that code provides complex code generation, type inference and declarative programming support.

In the first section on first class function support – I found on closer inspection (within LINQ at least) that these first class functions, are actually delivered through calls to the DynamicMethod method of System.Reflection.Emit. If you disassemble its code, you’ll see that the relationship between the imperative and functional programming in C# is…

View original post 61 more words

Functional Programming in C# – Higher-Order Functions

Andrew Matthews

  1. Functional Programming – Is it worth your time?
  2. Functional Programming in C# – Higher-Order Functions

This is the second in a series on the basics of functional programming using C#. My topic today is one I touched on last time, when I described the rights and privileges of a function as a first class citizen. I’m going to explore Higher-Order Functions this time. Higher-Order Functions are functions that themselves take or return functions. Meta-functions, if you like.

As I explained last time, my programming heritage is firmly in the object-oriented camp. For me, the construction, composition and manipulation of composite data structures is second nature. A higher-order function is the equivalent from the functional paradigm. You can compose, order and recurse a tree of functions in just the same way as you manipulate your data. I’m going to describe a few of the techniques for doing that using an example…

View original post 1,681 more words