This code has been in my drafts box for 2 years. I figured I'd just go ahead and publish it, though I'm unsure of the context now. 1$dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() 2$root = $dom.GetDirectoryEntry() 3$search = [System.DirectoryServices.DirectorySearcher]$root 4$search.Filter …
Read MoreSo I'm making the move to PowerShell. It's painful learning such alien (to me) concepts but books like Lee Holmes' PowerShell: The Definitive Guide help a ton. I was fortunate enough to be the editor for Chapters 1-5 and got a sneak preview. It's a fantastic book and can't wait to receive the title, complete with …
Read MoreWhen creating a new Active Directory user from the command line in PowerShell, you will likely find yourself using Read-Hosts's asSecureString switch when entering the password. $password = Read-Host "Enter password" -AsSecureString Next, you'll probably look around the Internets for a few hours or so trying …
Read More