Friday, 23 April 2010

Please Fill in this form....

One of the great things about Powershell is how it can help you remove repetative tasks,
it can run "any" application and perform "any" task and if you put it into the Scheduled Tasks system, it can do it over and over.

If you give it a small amount of information in can also gather in a huge amount on its own, from any number of sources,
for example Active Directory, a .CSV file, an Excel document or a SQL Database to mention a few.

This script does just that, it asks for a servicetag, it takes the tag and looks inside a .CSV file
where it finds the username of the user that is the primary user for that computer.
It then looks in Active Directory with the help of the Get-ADUser command found in the
RSAT Active Directory Module and collects even more information.

It then takes all that it has learned and puts that information into a Word Document (in this case a .Docx file)
with the help of predefined bookmarks and finally it prints out the document to the default printer.

In this example the Word Document is a form the user fills out when the computer
has suffered some major breakdown and is in need of service,
the IT guy\girl scans the servicetag and a form is printed.
No more sloppy handwriting, gone are the days when people ask "what's todays date?"
or "My Username?? I've got a Username!?!"

Powershell to the rescue!

Download it here:

Monday, 19 April 2010

New layout!

I've changed the layout since the previous one didn't have much space.
This might make previous posts seem weird ;)


Script to alter Computername in a SCCM Task Sequence.

If you need to change the name of a computer based on a pre-configured variable, this should help you to accomplish the task.

Download script from SkyDrive

To use the script, simply run it from a SCCM Task Sequence (Run Command Line f.ex) with the following string:
Cscript "pathtoscript"\NewComputerName.vbs /N:%VariableName%

If you wish to query the user for input, I suggest using OSD++, if you run OSD++ with the following XML,
the user can input a computer name and the input is stored in a SCCM Task Sequence called NewComputerName.

To use this input with the script, run the script with this string:
Cscript "pathtoscript"\NewComputerName.vbs /N:%NewComputerName%

Side note:
You can actually set the OSDComputerName Variable right in OSD++,
the reason I'm not doing so will become clear in a later post that is under construction.