Skip to main content

Posts

Powershell - Download and install Java using powershell

I got tired of updating the JRE package for our windows task sequences and used powershell to scrape for web-links from https://www.java.com/en/download/manual.jsp and install it silently.


Recent posts

Delete DEPROVISIONED okta users using API

Okta tombstones its users and does not delete them automatically when they are deactivated in AD. I use the below script to run on schedule with an okta API token to delete users:
You'll need the okta powershell module install and be a super user on okta :
https://github.com/okta/oktasdk-csharp/tree/master/Okta.Core.Automation/


#Import module oktaImport-Module Okta.Core.Automation#COnnect to okta using token and domainConnect-Okta -Token alphanumerictoken -FullDomain "https://domain.okta.com"###################Logging function$Logfile = "$env:ProgramData\InstallLogs\DeleteOktaUsers_$(get-date -format `"yyyyMMdd_hhmmsstt`").log"Function LogWrite($string, $color){ if ($Color -eq $null) {$color = "white"} write-host $string -foregroundcolor $color $string | out-file -Filepath $Logfile -append}if ((Test-Path -path C:\ProgramData\InstallLogs\) -ne $True){New-Item C:\ProgramData\InstallLogs\ -type directory}##################################…