PowerShell for Windows Admins:

Powershell


February 9, 2015  12:21 PM

Error when AD object not found

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

This one popes up quite frequently If you attempt to access an Active Directory object that doesn’t exist you get an error. £> Get-ADUser Richardp Get-ADUser : Cannot find an object with identity: 'Richardp' under: 'DC=Manticore,DC=org'. At line:1 char:1 + Get-ADUser Richardp +...

February 7, 2015  9:39 AM

Stages of panic

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

You’re working on a new script and something’s not working properly and you can’t figure it out. Panic level 1 is when you start using Get-Command and Get-member on everything in sight trying to figure out what’s wrong with the objects Panic level 2 is when you realise you have to...


February 6, 2015  2:17 PM

Workflow for last logon

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

PowerShell Workflows have been a bit of an underachiever in terms of their adoption and use. Something I read prompted the thought that there are a number of activities when working with Active Directory where you have to interrogate a number of machines to get the result. That’s something...


February 5, 2015  9:57 AM

Scripting Guy CDXML series finished

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

My CDXML series on the Scripting Guy blog finished today.  The 4 articles are: Bookmark and Share     0 Comments     RSS Feed     Email a friend


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


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...


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: