Hi, Today I found myself needing to run a PowerShell command from the command line. I ran powershell /? and had a look at the switches and there is a -Command switch. My first attempt to use the switch looked like:
Hello! Here’s a quick script that lets you query an SQL Database, store the results in an array and export to CSV. The script uses the .NET SQLClient class for connecting to the database and stores the results in a DataTable object. The connection string uses SQL authentication for the… Read more »
Hi Again, Recently we’ve been fed up with Deployed Printer Connections through Group Policy and have decided to map printers using a PowerShell logon script. We wanted printer additions, removals and defaults to be based on AD groups, and for the script to work with PowerShell 2.0. Our clients are… Read more »
Hi, As part of the MDT build process we set a couple of Registry Keys to tell us the status of the build (I.e in build or finished build) For logging purposes I retrieve the value of 2 keys from the registry, however when running the following command I get… Read more »
Ever wanted to have a custom PowerShell Object with custom property attributes? This can make your console output cleaner, and I also find it very useful when using Export-CSV. For the purpose of this post I’ve created an object that has 3 properties: “Hostname”, “Enabled”, and “NetworkUp”. The “Hostname” property… Read more »
Running the above code during the build process (i.e. inside the Task Sequence) lets me interact with any Task Sequence variable. I can obtain the value of any variable in the Task Sequence… Read more »
Hi All, We’ve recently started using MDT 2013 Update 1 and we’ve noticed some of the scripts that worked seamlessly in 2012 have started producing errors. We use the DISM PowerShell cmdlets to verify the consistency of WIM files post backup. If the cmdlet fails to verify the WIM file… Read more »
Hi There! This is the first post on JustAnotherITBlog.co.uk – Just a quick note to let you know what we’re about and why we’re here. Working in IT we encounter new problems on a daily basis, this blog is a place where we can share our findings and hopefully help… Read more »