SCCM – 1602 Release – free eBook

Hi together,

SCCM 1602 is now officially availlable with some interesting features.

Additional to this you should also take a closer look at this free ebook with lots of information:

Free ebook: Deploying Windows 10: Automating deployment by using System Center Configuration Manager

Continue reading

Advertisement

PS – External Utilities – german console with umlauts

Hi all,

i am using a german console with german words. Many of you know that we use “very special characters” also called umlauts: “ÄÜÖ”.

The interesting part is – if you try to use external tools as the following and they normally would return any values with umlauts this will not work out from Powershell; Let´s say for this example you created a shared directory named ‘ÄÜÖ’:

net.exe VIEW \\localhost\ /all

Here you would get something like this by using it in Powershell:


Freigabename  Typ     Verwendet als  Kommentar         

-------------------------------------------------------------------------------
ADMIN$        Platte                 Remoteverwaltung
Bilder        Platte
C$            Platte                 Standardfreigabe
IPC$          IPC                    Remote-IPC
print$        Platte                 Druckertreiber
Users         Platte
Ž™š           Platte
Der Befehl wurde erfolgreich ausgefhrt.

This error is caused by not matching encodings. Therefore these have to be set previously for the console itself. But here comes again another tricky part. Till now – you would get an error by setting the consoles encoding without having used the cmd.exe out of powershell before, because the handle to the console has to be created previously. Therefore the way to get this to work would be like this:

cmd /c ''
if ([Console]::OutputEncoding.CodePage -ne 852 )
{
    [Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding(852)
}
net.exe VIEW \\localhost\ /all

#getting only the specific line
net.exe VIEW \\localhost\ /all | Select-String 'Ö'
net.exe VIEW \\localhost\ /all | Where-Object { $_ -like '*Ö*' }

With following result:

Freigabename  Typ     Verwendet als  Kommentar         

-------------------------------------------------------------------------------
ADMIN$        Platte                 Remoteverwaltung  
Bilder        Platte                                   
C$            Platte                 Standardfreigabe  
IPC$          IPC                    Remote-IPC        
print$        Platte                 Druckertreiber    
Users         Platte                                   
ÄÖÜ           Platte                                   
Der Befehl wurde erfolgreich ausgeführt.

I am pretty sure that german readers may need this information some time.

Best regards,
David

New Job – Premier Field Engineer

MS.jpeg Hi together,

i have been very busy because i have switched jobs. Since 1st Feb. i am working for Microsoft itself! (Wuhu!) And yeah – it´s much to do!

My new job title is Premier Field Engineer and my specialties will be SCCM, Client and Powershell. Though i will be more focused on SCCM and Client and combining it as often as possible with Powershell 🙂

Because of this i will post a little more rarely in the next months, but be sure that i will provide you with some more useful and interesting stuff.

So – thank you all for reading and see you soon

David

PS – CleanUp HDD

Hello together,

today i want to show you a simple but effective method to cleanup your HDD. This will also remove the installation data of previous installations and may prompt therefore for authorization. Run it with admin rights.

CleanUp.png

More information here

Set-Location 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\'

foreach ($item in $(Get-ChildItem).PSPath)
{
    if (-not (Get-ItemProperty -Path $item -Name 'StateFlags1234'))
    {
        New-ItemProperty -Path $item -Name 'StateFlags1234' -Value 2
    }
}

cleanmgr.exe /sagerun:1234 

Greetings,

David

How to become a Powershell Pro?

PowershellPro

Hello together,

today i want to share my experiences of the last months with you where i worked nearly every day hours over hours on my Powershell skills. I have read a lot of books, watched douzens webinars, written many blog and forum posts and also thousands of lines powershell code. But not every material or action was reasonable at some learning point.

So i worked out – somewhat like – a learning plan. I will list up the best material  you should work on at a specific learning point. (as for my own personal opinion)
But keep in mind – this could vary for you. Persons are different as also their learning types. Some persons need to hear and see the things to capture the input better. Others learn best by reading and some need to interact as by writing.
But one thing is for sure – you will need a lot of practice and you will need to write scripts by yourself!

Continue reading

PS – RegEx and parsing log files – the nice way

Hello together,

today i want to show you a nice grab of the usage of Regular Expressions. Many people do not like Regex. Je – at the beginning these statements look like hieroglyphs but it will get better with the time.

First i will start with some trivial explanations how RegEx can be used in Powershell and will dive then deeper into more complex structures and lastly parsing log files giving us a nicely looking hash table with really nice features.

Continue reading

Client – Repairing Win 10 Apps with PS

Hello together,

today i want to share with you just two Powershell commands to reinstall Cortana or the Windows App Store if you are facing some problems with these:

Cortana:

Get-AppXPackage -Name Microsoft.Windows.Cortana | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}

Windows App Store:

Get-AppXPackage *WindowsStore* -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

Greetings,

David