Tag Archives: PS

Initialising arrays in PowerShell

Initializing arrays in PowerShell (en-US spelling for search engine purposes ). I think it’s taken me three years to work this out and it took a rushed script with a typo to figure it out.  Later I finally found the … Continue reading

Posted in Scripting | Tagged , , | Leave a comment

Obtaining a random result set in PowerShell

Given a set of data how does one return an arbitrary subset?  Well in T-SQL we’d do this: So how can we do this in PowerShell?  Well in pretty much the same way actually.  Pipe to Sort-Object and then to … Continue reading

Posted in Off-topic, Scripting | Tagged , , , | Leave a comment

Invoking (running) SQL Server Agent Jobs using PowerShell

As I navigate the meandering thread of complexities that is the identity management project I inevitably find myself using SQL Server more and more.  Forgone is the text delimited management agent; embraced is the database management agent (specifically, SQL Server).  … Continue reading

Posted in Scripting, SQL Server | Tagged , , , , , , , , | 1 Comment

SQL Server aliases

(a.k.a. Honestly…My top Layer-8 issue of 2010) SQL Server aliases: they need to be created on all clients that use them, not just the SQL Server! How do we create them?  Two primary ways: CLICONFG.EXE (%systemroot%\system32\cliconfg).  Native to Windows, the … Continue reading

Posted in Scripting, SQL Server | Tagged , , , , , , , , , , | 4 Comments

Querying AD DS 64-bit integer (date time as ticks) using LDP (or anything else)

I hacked together a .NET command line application for a customer yesterday that basically resets the password of all users within scope to two random passwords.  Such functionality was required because we’d P2V’d a production DC into the lab.  I … Continue reading

Posted in Active Directory, Scripting, Troubleshooting | Tagged , , , , , , , , , | Leave a comment

Converting System.Security.SecureString to String (in PowerShell)

I appreciate that most people won’t want to ever convert a secure string into a normal string however there’s a couple of reasons why you would even though there are security concerns. In my case I’m providing PowerShell scripts that … Continue reading

Posted in Scripting | Tagged , , , , | 3 Comments