PowerShell for Windows Admins:

Powershell


February 2, 2015  11:41 AM

Scripting Guy CDXML series

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Powershell

Today starts a four part series I’ve written for the Scripting Guy blog on using CDXML to create a module to work with the registry.  Don’t know what CDXML is – you will when you’ve read the series The first post is at

    0 Comments     RSS Feed     Email a friend

January 31, 2015  7:54 AM

Modifying text

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

I needed to modify some text somewhere in a file. The file looks like this ##  start file This is some text. I want to change something. But not this. ##  end file I was playing around with various options.  The simplest I found was this: £> $txt = Get-Content...


January 30, 2015  10:07 AM

Testing for a hotfix

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

KB3000850 – the November roll up for Windows 2012 R2 contains some very useful updates. I’ve installed it on some machines in my lab but not all. The update is huge so I’m installing it manually rather than through WSUS. I need to test a remote machine to determine if the update  is...


January 29, 2015  12:15 PM

Variable select

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

I was working on some code that  accesses a SQL database this afternoon. I only needed to pull back a single column from a single row but which column to pull back is variable depending on other data. That’s OK $query = “SELECT $colname FROM tablename WHERE x =...


January 27, 2015  1:47 PM

WMI errors

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell, WMI

Most PowerShell users will have done something like this: £> Get-WmiObject -ClassName Win32_ComputerSystem Domain              : WORKGROUP Manufacturer        : Microsoft Corporation Model               : Surface Pro 2 Name               ...


January 26, 2015  12:41 PM

Unravelling lists of distinguished names

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

There are a number of AD properties such as MemberOf and directrports that consist of a collection of distinguisednames.  Sometimes you need the  name  of the object rather than the distinguished name: function getname { [CmdletBinding()] param ( [string]$dn ) $name = Get-ADObject $dn...


January 26, 2015  11:08 AM

Filtering on if an AD property exists

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

There are times when you want to filter the results based on whether a user has an AD property set.  You could do this: Get-ADUser -Filter * -Properties Title | Where Title  | select Name, Title However, that involves pulling back all of the users and then filtering. Not very efficient...


January 21, 2015  12:21 PM

Awkward file and folder names

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Spent some time today dealing with a situation where there were special characters – namely [ ] in folder a file names £> Get-ChildItem -Path C:\Test Directory: C:\Test Mode                LastWriteTime     Length Name ----               ...


January 18, 2015  10:11 AM

PowerShell Summit NA 2015 Agenda changes

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

We’ve had to make some minor changes to the Summit agenda – the revised schedule is shown on the event web site - http://eventmgr.azurewebsites.net/event/home/PSNA15


January 18, 2015  5:02 AM

PowerShell Heroes 2015

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Powershell.org has announced the 2015 list of PowerShell Heroes-

    0 Comments     RSS Feed     Email a friend


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: