Store and restore passwords in PowerShell scripts

Posted on Leave a commentPosted in Scripts

Security is something that every administrator should take seriously.¬†Clear text passwords in (PowerShell) scripts is not something that is best practice and should be avoided or handled differently. In this post I am going to encrypt a password (not a username) using 128-bit AES encryption but the first step is to create a key so […]

Run a Powershell script as Scheduled Task

Posted on Leave a commentPosted in Scripts

Running a PowerShell script as scheduled task is not as easy as entering PowerShell.exe *script name.ps1*. I have been struggling with it for quite some time. Here is a command line to get it up and running: 1) Set the execution policy so script are allowed to run, open PowerShell and enter: Set-executionpolicy -scope currentuser […]

Disable Windows Installer Coordinator

Posted on 9 CommentsPosted in Scripts

When you use tools like Altiris or SCCM and you want to run scripts against Windows Server 2008, you need to disable a couple of things not to run into the Windows Installer scrolling window. The next GPO setting disables all the stuff that blocks these features: [Hanging Windows Installer Coordinator] A fix is available […]

Add a folder to the registry with a d-word value (with a space) from DOS using Altiris

Posted on Leave a commentPosted in Scripts

Today I was struggling to get a Command Prompt box, sent by Altiris, to run a PowerShell command with a space in it. Finally I got it fixed. The command is: 1) powershell.exe -command “& New-Item -path Registry::’HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppSrv’”   2) powershell.exe -command “& New-ItemProperty Registry::’HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppSrv’ -Name “TSMSI” -Value 0 -PropertyType “DWord”” […]

Wait replaced by Timeout

Posted on Leave a commentPosted in Scripts

In Windows 2008 and in Windows 7 the wait command is replaced by the Timeout command; For a timeout / wait of 10 seconds the command is: timeout /T 10 This works in PowerShell and also in Command Prompt.   Can’t get the solution to work? Contact me and let me do the trick.   […]