Musings on the splendour of PowerShell Browse by Tags - PoSh Chap - Site Home - TechNet Blogs

PoSh Chap

Musings on the splendour of PowerShell

Browse by Tags

Related Posts
  • Blog Post: Use PowerShell to Find Active Directory Forest Conflict Objects

    Quite often there's conflict amongst the PoSh progeny. Usually, the most belligerent sibling gets sent to their bedroom. In Active Directory, when there's a sibling name conflict the Relative Distinguished Name of the losing sibling is 'mangled', i.e. you'll see 'CNF:<guid>'...
  • Blog Post: Remove AD Child Domain with PowerShell

    It runs contrary to every paternal instinct to delete one's child. Still, child domains sometimes have to be removed. Today, we'll retire the child domain we created last week . Once more, you won't be surprised to hear that PowerShell makes this process quick and easy. Unto the breach...
  • Blog Post: Create AD Child Domain with PowerShell

    The other week I talked about the love that dares to speak its name (and building AD Forests). This week is about AD Domains and, er, well, creating children with PowerShell... (Note to self: must reword last sentence) ---------------------------------------------------------------------------...
  • Blog Post: RODCs Ahoy!

    I've recently had a couple more 'Hey,Scripting Guy! Blog' posts launched into the deep-blue sea. They make up a series on RODCs: 1. Use PowerShell to Work with RODC Accounts 2. Use PowerShell to Search Active Directory for High-Privileged Accounts 3. NEW: Weekend Scripter...
  • Blog Post: Use PowerShell and Repadmin to Check for Updates to High Privileged Groups

    To compliment their AD object auditing , one of my customers asked for a script sample to demonstrate an immediate analysis of membership updates to high privileged groups. Before I embarked upon a nice bit of scripting, I had a quick look to see if anyone had already produced something along those lines...
  • Blog Post: Create AD Forest with PowerShell

    Have I mentioned that I love PowerShell? Yes? Thought so... Here's YET ANOTHER reason why I love PowerShell. Take a look at how easy it is to create an Active Directory forest: Step 1 - Install Binaries on Server Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools ...
  • Blog Post: Use PowerShell and DSAMAIN.exe to Mount a Backup of NTDS.dit

    A few weeks back I talked about using PowerShell to create a regular System State backup. Have a look here for more information. This week, I'd like to talk about using PowerShell and DSAMAIN.exe to have a look at the point-in-time state of the Active Directory data captured in a backup. This...
  • Blog Post: Schedule a System State Backup with PowerShell

    In the wonderful world of Active Directory we're rather fond of System State backups. For starters, they allow for Authoritative and Non-Authoritative restores of both Active Directory and SYSVOL. Hopefully, you'll never find yourself in a situation where you have to restore a System State...
  • Blog Post: Scripting Tips and Tricks: 'Jagged' Arrays

    A jagged array is an array of arrays ! Eh? Come again? Well, in a jagged array, at least one 'compartment' or element contains a child array. Here’s what a simple jagged array (called $Array ) might look like when sketched out: 1 2, 3 3 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ...
  • Blog Post: Use PowerShell to Start Domain Controller Garbage Collection

    Garbage Collection runs every 12 hours on a domain controller. So, what is it, and, more importantly, how can we kick it off with PowerShell? What is it? Garbage collection identifies tombstones and recycled-objects that have been kept for at least the tombstone lifetime and then removes them. On...
  • Blog Post: Three Steps to PowerShell Module Success

    Your eyes haven't deceived you, my friend... create yourself a PowerShell module in just three easy steps! Here goes: Determine a Module Path Create the Module Folder Save your Functions to a PSM1 File And, that's it. No, really! Well, you also need to have written the...
  • Blog Post: Find, Disable and Move 'Stale' User or Computer Accounts

    Ho! Ho! Ho! A gift from me to you! Well, it's not much of a gift, but it's the gesture that counts! Here's a gift function I wrote recently: Find, Disable and Move 'Stale' Active Directory Accounts It helps you identify 'stale' user and computer accounts. It...
  • Blog Post: Tidy Up That Pesky Computers Container with PowerShell

    Another customer question (they're keeping the PoSh Chap blog in business)! By default, when a computer account is created it gets placed in the Computers container. Now, experience tells me that some folks aren't good at moving these computers to a production OU and as they're...
  • Blog Post: Scripting Tips and Tricks: Script Development with Splatting

    Advice can be given, ignored or taken. Over the next few weeks I'll write about some scripting practices I find useful and helpful. You can decide if these tips are for you... When writing a longer script I often have to work on it as and when I can. These scripts tend to have lots of parameters...
  • Blog Post: Scripting Tips and Tricks: Param()

    Param() - the next instalment in the exciting Scripting Tips and Tricks series! I'm a tidy person: tidy desk, tidy mind, and all that jazz. I believe in being as thorough and proper in my scripts and functions as possible. To that end, I delight in using PowerShell features such as: #Requires...
  • Blog Post: Use PowerShell to Check for High Privilege Group Membership

    Here's my latest 'Hey, Scripting Guy! Blog' outing: Use PowerShell to Search Active Directory for High-Privileged Accounts It's the second in a four-part series on securing and optimising RODC administration. Here's the first post: Use PowerShell to Work with RODC Accounts...
  • Blog Post: Verify Active Directory Group Naming Standards

    I love the stuff customers ask me! This week one of the chaps relatively new to PowerShell wanted some code to check for deviations from the organisation's group naming standards. A simple enough task, I thought, one he could accomplish with some pointers from me. My metaphorical gauntlet was...
  • Blog Post: One-Liner: Active Directory Protected Objects

    This week I was asked how to get a list of Active Directory protected objects with PowerShell. Protected objects can't be deleted as they are critical to the health of Active Directory. The easiest way I could think of is to use Get-ADObject with a specific LDAP filter. Get-ADObject -LDAPFilter...
  • Blog Post: Scripting Tips and Tricks: CmdletBinding()

    It's been a little while since we've had a Scripting Tips and Tricks post... and, boy, what a topic to return on - CmdletBinding! The last Tips and Tricks post talked about using Write-Verbose in scripts and advanced functions. It's just one of the features enabled with CmdletBinding ...
  • Blog Post: Help, I Need Connectivity!

    Help, not just any connectivity, Help, you know, I need a proxy... Won't you please, please help me? ... Right, note to self: ignore the catchy tune and write the post. Here goes... ... With v3 of PowerShell the Help System delivered a number of improvements. My favourite is the...
  • Blog Post: Introducing Scriptify!

    A bit of a departure this week... One of my colleagues in the UK has put together 'Scriptify' to categorise the 700+ SharePoint cmdlets: Scriptify As an administrative value-add and as a beginner's learning aid I really like the concept. What about applying this to the Active...
  • Blog Post: One-Liner: My Take On Finding Stale User and Computer Accounts

    Using PowerShell and information in Active Directory to identify 'stale' user or computer accounts is prone to inaccuracies. This is because there are many circumstances or technical nuances that can make the data unreliable. For example, think of a globe-trotting sales person, they (and their...
  • Blog Post: Managing Azure VMs with PS Remoting

    I'm a BIG fan of Microsoft Azure. I'm also a BIG fan of dystopian novels. What have the two got in common? Nothing, AFAIK, although I'm sure some tenuous links could be found by the hard-of-sleeping... Blimey, I'm off topic already... so, Microsoft Azure... I'm an even BIGGER fan...
  • Blog Post: One-Liner: Delegate Group Policy Management

    Here's a quick and easy way to delegate the management of existing Group Policy Objects in your domain. Set-GPPermission -All -Domain "halo.net" -TargetType Group -TargetName "Domain Local - Halo GPO Edit 1" -PermissionLevel GpoEdit What's going on here then? ...
  • Blog Post: Scripting Tips and Tricks: Write-Verbose

    A couple of weeks ago I reminisced about message boxes. In that post I mentioned that I use the Write-Verbose cmdlet in scripts. Here's how why and how... Why? Information sent to the verbose message stream can aid troubleshooting. It's also great for tracking the progress of a script or...