Category Archives: Powershell

Download a file with PowerShell

Sometimes you might need to download a file with PowerShell from a FTP-server or from a website. For instance, you might need a file from HR that contains new users that should be created in the local Active Directory. In … Continue reading

Posted in Powershell | Tagged , , , , , | 1 Comment

PowerShell Variables

Variables in PowerShell is used in almost every script, if not all of them. Variables allows us to save information that we can use later on in our script. To save a value in a variable, we simply type: $Number = … Continue reading

Posted in Powershell | Tagged , , | 1 Comment

PowerShell Guides

For a long time I was writing all my scripts in VB, something that at the time was powerful, and still is in certain areas. Long after PowerShell was introduced I still wrote most of my scripts in VB, thinking … Continue reading

Posted in Powershell | Tagged , , , | 6 Comments

How can I get the membership rules on all collections in a folder (Powershell)?

A few weeks back I was tasked with the enormous task of checking that all device-collections that were associated with an application were linked to a group in the Active Directory and that direct membership wasn’t used. If this had been … Continue reading

Posted in Powershell, SCCM | Tagged , , , , , , | 1 Comment

How can I list all available modules in PowerShell?

This is a quick post based on a question I got today. A friend wondered which PowerShell modules were available by standard in Windows 8.1. To get the complete list of all modules that are available on your system, simply … Continue reading

Posted in Powershell | Tagged , , , , | 1 Comment

Create and use a PowerShell console file

When writing scripts, sooner or later you will realize that you add the same snap ins all over again in different scripts. What you can do in this case is to export all loaded PowerShell snap ins from a console … Continue reading

Posted in Powershell | Tagged , , , , , | Leave a comment

Read XML-file in PowerShell

Today I will show you how to read a XML-file, something with endless possibilities. An example is if you have a file that contains information about users and you need to create new accounts in the Active Directory.

Posted in Powershell | Tagged , , | Leave a comment

Query SQL database from PowerShell

I’ve been working on a larger script where I needed to query a database to see if a value was present or not, something I thought was pretty much straight forward. However, this turned out to be a bit harder … Continue reading

Posted in Powershell | Tagged , , , , , , | 1 Comment

Install SQL Server PowerShell Module (SQLPS)

When installing SQL server, the PowerShell modules are installed by default, but if you wan’t to run scripts or commands from a computer/server that hasn’t got an installation of SQL, you need to install these manually.

Posted in Powershell | Tagged , , , , , | 2 Comments