Richard Siddaway

Explore articles and content from this author

Richard Siddaway

128 articles published

1 min read

Finding the domain controller that authenticated you

A question on my blog asked how do you know which domain controller you are running against when you search Active Directory. Unless you explicitly instruct your script to use a specific domain controller it will use the one to which you authenticated. You can find the DC to which you authenticated with this simple function function get-logonserver{ $env:LOGONSERVER -replace “\”, "" }

2 min read

Displaying data from multiple servers as HTML

A forum question regarding retrieving WMI based data from multiple servers and displaying it as HTML was interesting. I would approach it like this `$servers = Get-Content -Path C:\scripts\servers.txt $data = @( ) foreach ( $server in $servers ) { $compdata = New-Object -TypeName PSObject -Property @{ Computer = $server Contactable = $false LastBootTime = "" AllowTSConnections = $false } if ( Test-Connection -ComputerName $server -Quiet -Count 1 ) {

1 min read

Ensuring that parameter values are passed to your function

A question on the forum about a function had me thinking. The user had defined two parameters for the function and then used Read-Host to get the values. NO Much better way is to use an advanced function and make the parameters mandatory `function Getuserdetails { [ CmdletBinding ( ) ] param ( [ parameter ( Mandatory = $true ) ] [string] $Givenname , [ parameter ( Mandatory = $true

1 min read

PowerShell workflow articles

I"™ve written a series of articles on PowerShell workflows that are appearing on the Scripting Guy blog. The first two in the series have been published at: http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx Enjoy

1 min read

UK PowerShell Group sessions for 2013

This is the list of proposed sessions for 2013. It is subject to change depending on circumstances. All sessions are delivered by Live Meeting on Tuesdays at 7:30 UK time 29 January – PowerShell and Active Directory 26 February – PowerShell Advanced Functions 26 March – PowerShell cmdlets for Hyper-V 30 April – Notes from the PowerShell summit (may be changed) 21 May – Powershell Web Access 25 June – guest speaker PowerShell MVP Max Trinidad

1 min read

WMF compatibility

The Windows Management Framework 3.0 has been released as a Windows update. However there are some compatibility issues as documented on the PowerShell team blog. if you haven"™t see the post it here http://blogs.msdn.com/b/powershell/archive/2012/12/20/windows-management-framework-3-0-compatibility-update.aspx

1 min read

Renaming a user

I was asked about searching a user name for a string and replacing it so that the object is renamed. This is a three stage activity. First get the user. Two modify the name. Three rename the object. In active directory the name attribute has the LDAP name of cn but the Microsoft AD cmdlets treta it as name. So we end up with this code: `$user = Get-ADUser -Filter

1 min read

PowerShell Deep Dives

PowerShell Deep Dives is a book put together by the PowerShell community. I"™m editing one of the sections and have contributed some of the chapters. Manning have just started releasing it on their MEAP program. The full book will hopefully be ready in the spring. Best of all the royalties are being donated to worthwhile cause. Check it out – http://manning.com/hicks/