Deploy powershell script like SCCM application

HowTo, PowerShell Scrtips

Have some files and wish to come to a distillation folder using SCCM. It necessary to look like application deploy.

  1. Create PS script like this for Install

    2. Create PS script for uninstall

    3. Create two cmd scripts for run powershell ps1 files when user press «install» and «uninstall» using sccm software center

    4. Create application in SCCM

Quick copy software to target location by powershell



Set autoreply state for mailbox



Export/import AD objects (users, OUs)

HowTo, PowerShell Scrtips


Create AD user using json

PowerShell Scrtips


Some old work script

PowerShell Scrtips

Переименование компьютеров удаленно через powershell [Remote rename computers by powershell]

PowerShell Scrtips, Process automation


PowerShell Regex To Get Value Between Quotation Marks

HowTo, PowerShell Scrtips

If you’ve got a value like the following…


… that maybe came from the body of a file, was returned by some other part of a script, etc., and you just want the portions that are actually between the quotes, the quickest and easiest way to get it is through a regular expression match.

That’s right, forget splitting or trimming or doing other weird string manipulation stuff. Just use the [regex]::matches() feature of PowerShell to get your values.

Matches takes two parameters. 1. The value to look for matches in, in this case the here-string in my $s variable, and 2. The regular expression to be used for matching. Since Matchesreturns a few items, we are making sure to just select the value for each match.

So what is that regex doing? Let’s break it down into it’s parts.

  • (?<=\”) this part is a look behind as specified by the ?<= part. In this case, whatever we are matching will come right after a quote. Doing the look behind prevents the quotation mark itself from actually being part of the matched value. Notice I have to escape the quotation mark character.
  • .+? this part basically matches as many characters as it takes to get to whatever the next part of the regex is. Look into regex lazy mode vs greedy mode.
  • (?=\”) this part is a look ahead as specified by the ?= part. We’re looking ahead for a quotation mark because whatever comes after our match is done will be a quotation mark.

So basically what we’ve got is “whatever comes after a quotation mark, and as much of that as you need until you get to another quotation mark”. Easy, right? Don’t you love regex?


HowTo, PowerShell Scrtips



As in every programming and scripting language, in PowerShell there are special characters that you can use to represent characters, that we are not able to find in the standard set. In this tutorials we will see those PowerShell special Characters and what is their use.

All special characters in PowerShell start with backtick ( ). You can use the special characters only within double quotes ( " " ). If they are used otherwise, they will not be interpreted to the desired one. First of all we will see the list of characters and then we will go through it to see more details for each of the special characters. The list is provided by Microsoft.

Special Characters List: