PowerShell for Windows Admins:

Powershell


June 27, 2016  12:57 PM

PowerShell Summit & Conference videos 2016

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

If you didn’t get to any of these conferences this year the videos are now available. PowerShell and DevOps Summit 0 Comments     RSS Feed     Email a friend

June 25, 2016  9:17 AM

Parallel processing

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

One of the great features PowerShell brings is the ability to remotely administer your servers. Most people begin remote administration by processing the servers sequentially. Eventually, this process breaks down because you have too many servers and/or the processes you are running against each...


June 12, 2016  4:22 AM

Months

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

It would be nice to be able to do this: PS>  Get-Date -Day 25 -Month December -Year 2016 Get-Date : Cannot bind parameter 'Month'. Cannot convert value "December" to type "System.Int32". Error: "Input string was not in a correct format." At line:1 char:25 + Get-Date -Day 25 -Month...


June 11, 2016  4:28 AM

WMI classes and Storage cmdlets

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Powershell, WMI

There is a hierarchy of objects to work through when dealing with disks First you have the physical disk PS>  Get-CimInstance -ClassName Win32_DiskDrive | fl Partitions : 5 DeviceID   : \\.\PHYSICALDRIVE0 Model      : HFS256G3AMNB-2200A Size       :...


June 10, 2016  6:59 AM

WMI Filters

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Powershell, WMI

A common mistake with WMI/CIM filters is: PS>  Get-WmiObject -Class Win32_LogicalDisk -Filter "DeviceId=C:" Get-WmiObject : Invalid query "select * from Win32_LogicalDisk where DeviceId=C:" At line:1 char:1 + Get-WmiObject -Class Win32_LogicalDisk -Filter "DeviceId=C:" +...


June 8, 2016  5:13 AM

32 or 64 and/or Administrator

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

When you run the PowerShell console (or ISE) the default icon runs a 32 or 64 bit version that matches your OS. On a 64 bit machine you have the option of running in 32bit (icons have a (x86) suffix on the title. How can you tell whether you’re running in 32 or 64 bit mode? One way is shown...


June 7, 2016  4:03 AM

Local Administrators

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Finding the local administrators on a system is a not infrequent action.  There are a number of ways to do this. The oldest method is to use the ADSI WinNT provider $group =[ADSI]"WinNT://$($env:COMPUTERNAME)/Administrators, group" $members = @($group.psbase.Invoke("Members")) $members |...


June 6, 2016  3:39 AM

PowerShell Summit 2017–request for topics

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The PowerShell Summit is a community event. PowerShell.orh may organise it but we’re very aware that it is the PowerShell community’s event. We’ve been planning the  2017 Summit for a while and we’ve reached a point in the process where we need your help. What topics would you like...


June 1, 2016  1:54 PM

Dates in file and folder

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

If you want to incorporate the date in a file or folder name you can’t use Get-Date directly PS>  Get-Date 01 June 2016 20:52:03 The simplest answer is to use the –Format or –Uformat parameters: PS>  Get-Date -Format yyyyMMdd 20160601 PS>  Get-Date -UFormat...


May 31, 2016  3:19 PM

Counting members

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

If you have a collection of objects $proc = get-process you can get the number of members using the Length property PS>  $proc.Length 71 $proc is of type System.Array PS>  $proc.GetType() IsPublic IsSerial...


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: