by skufel | May 11, 2015 | Automation, Scripting, SysAdmin, Windows
If you want to send email from PowerShell script via Google Mail: $SMTPServer = "smtp.gmail.com" $SMTPPort = "587" $SMTPUsername = "sender@gmail.com" $SMTPPassword = "password" $EmailSenderAddress = New-Object...
by skufel | May 11, 2015 | Automation, Scripting, SysAdmin, Windows
Many times there is a need to store password in PowerShell script. Unfortunately to leave password in script is insecure solution and might cause an issue. So, what to do if there is a need to have password in a script and we don’t want to have it embedded in...
by skufel | Mar 25, 2015 | Automation, Scripting, Windows
If you want to replace string in multiple files name you can simply use PowerShell for that. Dir -Recurse | Rename-Item -NewName { $_.name -replace "file","name-of-file"...
by skufel | Oct 30, 2014 | Automation, Infrastructure, Scripting, SysAdmin, Windows
If there is a need to pass specific credentials to Get-WmiObject in order to gather information from remote machine, here is how you can do it: $LAdmin = "DOMAIN\Administrator" $LPassword = ConvertTo-SecureString "Password!" -AsPlainText -Force...
by skufel | Oct 21, 2014 | Automation, Infrastructure, Scripting, SysAdmin, System Center
During mass reainstallation/redeployment/migration of large number of PCs, always question about applications is raised. How to deploy/deliver applications once all machines are resintalled? If you have SCCM in the infrastructure, this might help a lot with...