Tag Archives: Scripting

PowerShell: Test-IsAdmin

Sometimes I only want a PowerShell script to run only if the user has local admin rights. This can be tested for by looking for the admin token. Here’s a function I use. I then call the function in my code using … Continue reading

Posted in PowerShell | Tagged , , | Leave a comment

PowerShell: New-Password Function

OK, so I’ve been off the grid for a while now. But that doesn’t mean I’ve not been busy. Quite the opposite in fact. I’ve taken a year out from work on paternity with my baby Son. During this time, … Continue reading

Posted in PowerShell | Tagged , , | 10 Comments

LTI/ZTI PowerShell: Outputting Transcript from PowerShell Console

While testing a Lite-Touch deployment, I had an issue with a PowerShell script running in an application package. The error flashed by on the console screen so fast that I could not read it. To top that off, the log file … Continue reading

Posted in MDT 2010, MDT 2012, PowerShell, SCCM, Scripting | Tagged , , , | 6 Comments

LTI/ZTI PowerShell: Using Modules in deployment scripts

A great feature of PowerShell is the use of Modules. You use modules to store reusable code such as functions as an alternate to storing hefty code at the start of your scripts. MDT supports the use of modules in … Continue reading

Posted in MDT 2010, MDT 2012, PowerShell, Scripting | Tagged , , , | Leave a comment

LTI/ZTI PowerShell: Exit codes

When you run a script in your deployments, it’s good practice to let MDT/SCCM know how the script has ended. This will determine how your task sequence proceeds. You do this by exiting the script with a return code. I’ve … Continue reading

Posted in MDT 2010, MDT 2012, PowerShell, SCCM, Scripting | Tagged , , , | Leave a comment

LTI/ZTI PowerShell: Debugging Scripts (Part 3 of 3)

Testings results with a test matrix My Rename-Computer script is in production and I’ve made some major changes to it so it’s time for some major testing.  It’s important when testing your scripts to understand and document what your expected … Continue reading

Posted in MDT 2010, MDT 2012, PowerShell, SCCM, Scripting | Tagged , , , , , | Leave a comment

LTI/ZTI PowerShell: Debugging Scripts (Part 2 of 3)

Testing variables with the ZTIUtility module My Rename-Computer script worked great on a computer in a workgroup environment. But now, I have a new server that I want to rename before I join it to a domain. I’ve worked out … Continue reading

Posted in MDT 2010, MDT 2012, PowerShell, SCCM, Scripting | Tagged , , , , , | Leave a comment