This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Name of the script: ADPwdExpired.ps1 | |
Author of the script: Jason Hamilton, www.404TechSupport.com | |
Version of the script: 0.1 | |
Description: Query Active Directory for number of users with expired or expiring (in next 30 days) passwords | |
Version of PowerShell required: 3.0 | |
If Elevated permissions required: No, but read access to AD is required. | |
If specific modules are required: No. | |
Ideas for future improvement: | |
Known errors: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Name of the script: SophosPolicyUpdate | |
Author of the script: Jason Hamilton | |
Version of the script: 0.1 | |
Where you got the idea: Needed to force VDI clients to check for new policy information from Sophos | |
Version of PowerShell required: 3.0 | |
If Elevated permissions required: Yes, assigned as Startup script, so runs as SYSTEM | |
If specific modules are required: No | |
Comments about new types of constructions: N/A | |
Comments about specific cmdlets: N/A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$site = Invoke-WebRequest -Uri https://www.404techsupport.com/ | |
#$site.Links | Out-GridView | |
$title = $site.AllElements | WHERE Class -eq "entry-title" | Select-Object -First 1 | |
$date = $site.AllElements | WHERE Class -eq "entry-time" | Select-Object -First 1 | |
Clear-Host | |
Write-Host "Latest article from 404TechSupport.com:" | |
$title.innerText | |
$date.datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Name of the script: UninstallQuickTime.ps1 | |
Author of the script: Jason Hamilton | |
Author contact information: https://www.404techsupport.com/ | |
Version of the script: 0.1 | |
Where you got the idea: QuickTime deprecated by Apple | |
Version of PowerShell required: 3.0 | |
If Elevated permissions required: Yes | |
If specific modules are required: No | |
Comments about new types of constructions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$profiles = $null | |
$profiles = Get-WMIObject -class Win32_UserProfile | Where {((!$_.Special) -and ($_.LocalPath -ne "C:\Users\Administrator") -and ($_.LocalPath -ne "C:\Users\UpdatusUser"))} | |
if ($profiles -ne $null) { | |
$profiles | Remove-WmiObject | |
} | |
Exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PowerShell Building Blocks | |
#Single-line comments begin with a pound sign. | |
<# Multi-line comments can span between angle brackets and pound signs. | |
Just like this. | |
The syntax highlighter in PowerShell ISE colors comments green so they're easy to see. #> | |
#Output | |
#Output to the monitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get AD computers where attribute is not null | |
$PCs = Get-ADComputer -Filter {ms-Mcs-AdmPwd -like "*"} -Properties Name, ms-Mcs-AdmPwd, ms-Mcs-AdmPwdExpirationTime | sort Name | ft Name, ms-Mcs-AdmPwd, ms-Mcs-AdmPwdExpirationTime | |
$PCs | |
Write-Host $PCs.count "Computers with LAPS enabled" |