Author Archives: richardsiddaway

DSC validation

The PowerShell team are asking for validation and feedback on the DSC features in WMF 5.0 – http://blogs.msdn.com/b/powershell/archive/2015/07/06/validate-features-of-powershell-dsc.aspx First up is the PowerShell DSC RunAsCredential – http://blogs.msdn.com/b/powershell/archive/2015/07/06/validate-powershell-dsc-runascredential.aspx Other features will be explained and your validation solicited over the course of … Continue reading

Posted in DSC, WMFv5 | Leave a comment

Number of working days

Need to know the number of working days left until a specific date? $we = [System.DayOfWeek]::Saturday, [System.DayOfWeek]::Sunday $date = Get-Date -Year 2015 -Month 8 -Day 28 $now = (Get-Date).AddDays(-1) $workdays = 0 while ($now -le $date){ $now = $now.AddDays(1) if ($now.DayOfWeek … Continue reading

Posted in Powershell Basics | Leave a comment

Scripting Guy new series

Ed Wilson, the Scripting Guy, is starting a new series of posts on writing PowerShell scripts – he’ll also cover what to script, when to script and when to work interactively. First post is here http://blogs.technet.com/b/heyscriptingguy/archive/2015/07/05/weekend-scripter-when-to-write-a-powershell-script.aspx Strongly recommend this series … Continue reading

Posted in Powershell | Leave a comment

Scripting Games July 2015 puzzle

Head over to http://powershell.org/wp/2015/07/04/2015-july-scripting-games-puzzle/ for our inaugural Scripting Games puzzle. I’ll publish a solution at the end of the month

Posted in Powershell, powershell.org, Scripting Games | Leave a comment

Processing NULL AD values

Back in this post https://richardspowershellblog.wordpress.com/2012/12/09/bulk-modifications-using-set-aduser/ I showed how to perform a bulk change to a number of AD accounts using a CSV file to input the data I was recently asked what happens if one of the input values is … Continue reading

Posted in PowerShell and Active Directory | Leave a comment

String startswith method

If you look at the methods available on a string one of them is StartsWith(). It tests if a given string starts with another string £> ‘frgrughrugu’.StartsWith OverloadDefinitions——————-bool StartsWith(string value)bool StartsWith(string value, System.StringComparison comparisonType)bool StartsWith(string value, bool ignoreCase, cultureinfo culture) … Continue reading

Posted in Powershell Basics | Leave a comment

Domain Admins password last set

A recent question on the forums asked about getting the date a password was last set and the password never expires status for the domain admins group This is one way of doing it Get-ADGroupMember -Identity ‘Domain Admins’ | foreach … Continue reading

Posted in PowerShell and Active Directory | Leave a comment