Skip to main content

Posts

Showing posts with the label links

Nice post on arrays

Hi I've justhad a comment from a colleague that i haven't put anything up here for a while (thanks Dimce!), which is very true - i can only hold my head in shame! Since that comment, i have found a very nice (albiet from a few years back) article about arrays from Bruce Payette http://blogs.msdn.com/b/powershell/archive/2007/01/23/array-literals-in-powershell.aspx?wa=wsignin1.0 this just says to me that for however long you use powershell, there is always something more to learn! cheers Adam

Powershell 2 Try / Catch Exceptions

Powershell 2 Try / Catch Exceptions Powershell 2 has a new error handling function in Try / Catch.  The official help file for full details on how to run the command can be found here .  The part I have been looking into is how to define the exceptions which led me to a page on MSDN which lists the inheretance of the class system.exception  - essentially the values allowed in the Catch part of the Try / Catch.  Adding this page to links!

Computer Password Changes in AD

In trying to resolve an issue with regards to computers loosing thier trust relationship with the domain, I found this increadibly good explaination  of how passwords are used and changed in AD.  It goes a long way to explain where is the password change is initiated (the computer, not a DC), what is required to be in place before the change can happen and how it works around an issues it may face. Thanks Manish Singh (from the Directory Services team) for such a detailed post. Added to links too!

Hash Tables - DC operating systems

I have been meaning to get my head around a lot of different aspects of powershell, one of which is hash tables.  As we are currently going through a DC upgrade, I wanted to know how many DC's we had of each different operating system.  I wondered if hash tables would help me. First, I got all DC's in my domain :  $DClist = get-ADDomainController -server domain.com -filter {enabled -eq $true} You may notice the get-ad portion of the command....this means that this command runs only on powershell 2 when connected to an Windows 2008 R2 DC or a 2003 / 2008 DC with ADMGS installed.  So, $DCList is now all the DC's from domain.com (-server domain.com) that are set to enabled (-filter {enabled -eq $true}).  NOTE: The only DC's that are not enabled are pre-staged RODC accounts ... by that i mean accounts that have been created but the server has not come online yet.  These servers do not have any OS information in them anyway. It is more helpful...

First Post

Why is the first post always the hardest?   Of all the things i have been doing recently with AD and powershell, there are always a couple of links i keep to hand, i have put them in my Resource links section.  The quick start guide is a great mini-resource straight from MSDN that always helps out with syntax if I get a brain freeze.  The other one on the other hand is the full blown AD .net class of which i have been delving through over the past couple of years.  I don't yet know how much of this has been implemented in the new powershell 2.0 cmdlets, but i will hopefully soon find out! cheers!