PowerShell for Windows Admins:

May, 2012


May 16, 2012  3:12 PM

TCP/IP Alternative Configuration: pt II Set DHCP

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

The next step on our journey to an alternative configuration is setting the NIC to use DHCP

I will keep cheating for now and specify the NIC – on my machine I now it is the NIC whose Win32_NetworkAdapterConfiguration has an Index of 7


				 0 Comments
				   

				  RSS Feed
				   

				  Email a friend

			
			
		

May 16, 2012  1:50 PM

Scripting Games 2012 comments: #19 default parameters

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

I often saw scripts that did something like this

function test1 {            
 param (            
  ...


May 15, 2012  3:26 PM

Scripting Games 2012 comments: #18 computer names

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

I have mentioned computer names a few times. One oddity is accessing the local machine.

There are three options

  • dot  .
  • localhost
  • $env:COMPUTERNAME

There are a number of occasions when . and localhost fail.

For...


May 15, 2012  11:37 AM

Test-Connection on PowerShell v3

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Following on from the previous post I performed the same tests on PowerShell v3

The behaviour is the same except that

Test-Connection -ComputerName . -Count 4 –AsJob

now give the 4 pings when you receive the job information


May 14, 2012  3:23 PM

Test-Connection oddities

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

I’ve playing around with Test-Connection because I wanted to set up a long running WMI based job and I thought that pinging a machine lots of times would be a good way to do it. Test-Connection uses the Win32-PingStatus class.

I started with this

0 Comments     RSS Feed     Email a friend


May 14, 2012  11:21 AM

Scripting Games 2012 comments: #17 opening a csv file

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Some of the events involved creating a CSV file. While it wasn’t explicitly asked that you opened the file many entrants chose to add that code to their scripts.

There were a number of options presented – most involving opening Excel and importing the CSV file.

There is a...


May 13, 2012  11:25 AM

Scripting Games 2012 comments: #16 reading environmental variables

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Windows maintains a set of environmental variables. Some, but not all, can be seen via the env: PowerShell drive Get-ChildItem -Path env: You can also use WMI to see some of the variables Get-WmiObject -Class Win32_Environment | ft Name, VariableValue –a Now how do you read them in...


May 13, 2012  10:34 AM

TCP/IP Alternative Configuration: pt I The configuration

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

A question on the forum got me wondering about setting the Alternative Configuration on a TCP/IP properties of a network adapter. NICs are normally configured to either DHCP or a static address. If you use DHCP another tab “Alternative Configuration” appears on the IPv4 properties dialog. This...


May 13, 2012  6:54 AM

PowerShell User Group Recodings

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

A number of the recent UK PowerShell group sessions are available as recordings for download.  The slides and demo scripts are usually included in the download package. They can be downloaded from mu skydrive under the PowerShell User group folder.


May 8, 2012  1:22 PM

Scripting Games 2012 comments: #15 pipelines

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

There are a few comments to make about using the pipeline but one of the obvious issues I saw from the games was this type of approach $p = Get-Process $p | where {$_.Name -like "powershell*"} The only time this is valid is if you need to access exactly the same data later in your...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: