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
### GetMailAutoReply.ps1 | |
<# | |
.SYNOPSIS | |
Gets a users current auto reply message and state. | |
#> | |
param | |
( | |
[Parameter(Mandatory = $true, |
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
$Option = New-ScheduledJobOption -RunElevated -RequireNetwork | |
Register-ScheduledJob -ScriptBlock {Add-Content -Path C:\temp\joblog.txt -Value (Get-Date)} -Name 'Test Job' -ScheduledJobOption $Option -RunNow | |
$CurrentAction = (Get-ScheduledTask -TaskName 'Test Job').actions | |
$Params = @{ | |
Id = $CurrentAction.Id | |
Argument = $CurrentAction.Arguments | |
Execute = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' | |
} |
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
# Unfortunatly, it's not currently possible to give New-BurntToastNotification multiple progressbars... so diving into all of these other functions are needed. | |
# I'll fix this in the next version of BurntToast. | |
$Text1 = New-BTText -Content 'Printer01 Toner Levels' | |
$BlackProgressBar = New-BTProgressBar -Status 'Black' -Value 0.3 | |
$YellowProgressBar = New-BTProgressBar -Status 'Yellow' -Value 0.9 | |
$MagentaProgressBar = New-BTProgressBar -Status 'Magenta' -Value 0.75 | |
$CyanProgressBar = New-BTProgressBar -Status 'Cyan' -Value 0.1 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | |
<Product Id="*" UpgradeCode="__GUID1__" Version="1.0.0.0" Language="1033" Name="__NAME__" Manufacturer="__MANUFACTURER__"> | |
<Package InstallerVersion="300" Compressed="yes"/> | |
<Media Id="1" Cabinet="__NAME__.cab" EmbedCab="yes" /> | |
<Directory Id="TARGETDIR" Name="SourceDir"> | |
<Directory Id="ProgramFilesFolder"> | |
<Directory Id="APPLICATIONROOTDIRECTORY" Name="__NAME__"/> | |
</Directory> |
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
$JobBlock = { | |
$ExpiryTime = Get-ADUser $env:USERNAME -Properties 'msDS-UserPasswordExpiryTimeComputed' | |
$Expiry = [datetime]::FromFileTime($ExpiryTime.'msDS-UserPasswordExpiryTimeComputed') | |
$TimeToGo = New-TimeSpan -Start (Get-Date) -End $Expiry | |
if ($TimeToGo -le 3) { | |
if ($TimeToGo.Days -gt 0) { | |
$Count = $TimeToGo.Days | |
$Unit = 'Days' |
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
#Requires -Modules PoshRSJob, PoshPctBar, ActiveDirectory | |
function New-StorageReport { | |
<# | |
.SYNOPSIS | |
Creates a new Server Storage Report. | |
.DESCRIPTION | |
The New-StorageReport function creates a new Storage Report of local disks on all servers in a specific Organizational Unit in Active Directory. | |
.INPUTS | |
None. | |
.OUTPUTS |
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
#Requires -Version 3.0 | |
#Requires -Modules MSOnline, SkypeOnlineConnector, Microsoft.Online.SharePoint.PowerShell | |
<# | |
Required downloads | |
Microsoft Azure Active Directory Module for Windows PowerShell | |
32-bit: http://aka.ms/fohrds | |
64-bit: http://aka.ms/siqtee | |
Skype for Business Online Connector: http://aka.ms/x3kyib |
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
$path = 'HKCU:\Software\Microsoft\Internet Explorer\Main\' | |
#First page | |
$name = 'start page' | |
$value = 'https://www.google.com/?gws_rd=ssl' | |
Set-Itemproperty -Path $path -Name $name -Value $value | |
#Additional pages | |
$name = 'Secondary Start Pages' | |
$value = @('https://secondpage.com/', 'https://thirdpage.co.nz') |
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
$ThemeLists = 'http://putty.org.ru/themes/index.html', 'http://putty.org.ru/themes/page2.html', 'http://putty.org.ru/themes/page3.html', 'http://putty.org.ru/themes/page4.html', 'http://putty.org.ru/themes/page5.html' | |
foreach ($Uri in $ThemeLists) | |
{ | |
$Content = Invoke-WebRequest -Uri $Uri | |
$List = $Content.ParsedHtml.getElementsByTagName('ol') | |
$Links = $List[0] | foreach {$_.getElementsByTagName('a') | where {$_.textContent -ne $null} } | |
foreach ($Link in $Links) | |
{ |
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
$Group = Read-Host -Prompt 'Specify problem group' | |
Get-AdGroupMember -Identity $Group -Recursive | | |
Where-Object -FilterScript {$_.objectClass -eq 'user'} | | |
Get-AdUser -Properties 'EmailAddress', 'Department' | | |
Select-Object 'Name', 'EmailAddress', 'Department' | |
<# | |
Assumptions: | |
* Execution policy configured so this can run | |
* Person running this has proper access to Active Directory |