Nah, you can't just copy and paste the script. You have to do a bit of "designing" here.
First off, ignore my previous comment re: using clauses not being allowed... I was thinking of the Script generator. The Code/Script component should allow the specification of using clauses. Instructions below should apply to both Code/Script comp and Script generator aparat from differences I point out.
1. First, to make the component "interesting", I'd make the component take in at least one text parameter - the name of the (wo)man whose PW exp. date you're interested in. You could add additional parameters to specify the other vars used to build the LDAP query, but I'd start with one parameter and eventually build up to more parameters - it's just easier that way.
2. The output would be a non-array datetime.
3. This comp lets you choose which language you want to script in... C#, VB.NET or JScript. The examples I cited were C#. Script generator doesn't let you pick this - it's always C# in the script gen.
4. For the using clauses, I'd add them one by one, making sure to get the casing correct. C# is a case sensitive language. You can't do this in the script generator... have to get around it in the code with trick I mentioned above.
5. Finally, I'd drop in the script (the contents of the Main() function in the first link I posted earlier). You have to adjust the LDAP building portion of the code to incorporate the name input you specified earlier. You also need to account for YOUR AD here, and not the one specified in the linked code. We basically just want to return a date, so you'll have to fix the code a bit to do a
return blah;
vs. a
Console.WriteLine(blah);
It helps to have a bit of C# experience to use this component (Script generator as well). If you have Visual Studio or some other IDE available, it REALLY REALLY helps to build out a small project that emulates what you want to do locally, THEN copy and paste into the Code/Script comp or Script gen. Otherwise, re-running this editor, and re-debugging your flow becomes your IDE - and that will get maddening very quickly to try and get this to work.
Hope this helps.