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 CredentialManager | |
#requires -version 5 | |
<# | |
.SYNOPSIS | |
Checks to see if OneDrive credential is saved, if so starts OneDrive with /background switch. | |
.DESCRIPTION | |
Checks to see if OneDrive credential is saved, if so starts OneDrive with /background switch. Otherwise starts OneDrive normally. Intended to be used in a Citrix XenApp/Virtual Apps environment. Reccomented to run from Task Scheduler using the at logon trigger or using WEM. | |
.NOTES |
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
Function Test-CaptivePortal { | |
<# | |
.SYNOPSIS | |
Tests internet connectivity using Microsoft's capitve portal test site. Returns $true if a captive portal is detected, otherwise false. | |
.DESCRIPTION | |
Tests internet connectivity using Microsoft's capitve portal test site. Returns $true if a captive portal is detected, otherwise false. | |
For more information on Windows Network Awareness, see | |
* https://docs.microsoft.com/en-us/windows-hardware/drivers/mobilebroadband/captive-portals | |
* https://blog.superuser.com/2011/05/16/windows-7-network-awareness/ |
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
Function Get-XDayOfMonth { | |
<# | |
.SYNOPSIS | |
Returns the date of the requested day of the month. | |
.DESCRIPTION | |
This function will return the date for searches such as the third Tuesday of July 2018 or the Second Friday in August 2002. | |
.PARAMETER Find | |
What day to find: First, Second, Third, Fourth, Last. (Numbers 1-5 are also valid, 1 being First 5 being last.) |
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 WSUS to be on Server 2012 R2 and the right version of PowerShell. | |
$WSUSServer = "wsusserver.example.com" | |
$WSUSPort = "8531" | |
$UseSsl = $true | |
$outfile = "E:\WSUS\Cleanup-Result.txt" | |
if ($UseSsl) { | |
$WSUSServer = Get-WsusServer -Name $WSUSServer -PortNumber $WSUSPort -UseSsl | |
} | |
else { |
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
# I needed two credential objects, one with username, the other DOMAIN\username. | |
# Same account, just different formats for username required. | |
# Use Get-Credential unless you have a special case like this one. | |
$valid_user = $false | |
# Infinite loop until proper username is entered. | |
while (-Not $valid_user) { | |
Write-Host "Enter username in DOMAIN\username format." -ForegroundColor DarkCyan | |
Write-Host "Press Ctrl+C to exit script." -ForegroundColor DarkCyan | |
$username = Read-Host -Prompt "Username" | |
$username = $username.Trim() |
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
<# | |
Edits the SplunkUniversalForwarder config files to put in the correct hostname, restarts the service. | |
Running as an Windows Startup Script is reccomended. | |
#> | |
# Target files and strings, thank you grep for windows. | |
# C:\Program Files\SplunkUniversalForwarder\etc\system/local/inputs.conf:host = servernamehere | |
# C:\Program Files\SplunkUniversalForwarder\etc\system/local/server.conf:serverName = servernamehere | |
# First, cehck that the Universal Forwarder is installed. |
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
' VBScript that searches an OU (and it's sub OUs) for inactive computer accounts. | |
' If it finds inactive computer accounts, they are disabled and a comment is added. | |
' Uses DSQuery.exe, which is part of Windows XP or Windows Server 2003 | |
' Written by Andrew Zbikowski <andyzib@gmail.com> | |
Option Explicit | |
' Objects | |
Dim objShell, objScriptExec, objComputer |