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
<# | |
.SYNOPSIS | |
Get-WinEvent with xml property expansion | |
.EXAMPLE | |
This will get user logoff events from localhost & 'target1' for user 'User42' | |
$WinEventParams = @{ | |
ComputerName = $env:COMPUTERNAME, 'target1' | |
LogName = 'Security' | |
ID = 4647, 4634 |
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
Write-Verbose "Disable power saving on hardware network interfaces" | |
foreach ($NIC in (Get-NetAdapter -Physical)) { | |
$PowerSaving = Get-CimInstance -ClassName MSPower_DeviceEnable -Namespace root\wmi | Where-Object { $_.InstanceName -match [Regex]::Escape($NIC.PnPDeviceID) } | |
if ($PowerSaving.Enable) { | |
$PowerSaving.Enable = $false | |
$PowerSaving | Set-CimInstance *>&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
#Requires -Module PSWriteHtml | |
#Requires -PSSnapin Citrix.Broker.Admin.V2 | |
# Author: Adam Yarborough, 2020. | |
# Usage: .\Create-CitrixApplicationReference.ps1 -AdminAddress 'ddc1.domain.com' -Outfile 'C:\Reports\Whatever.html' | |
[cmdletbinding()] | |
param ( | |
[string]$AdminAddress = $env:COMPUTERNAME, | |
[switch]$IgnoreApplicationsWithNoUsers, |
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
# Make an admin portal config file for your network printers web interfaces! | |
# This script will take the supplied print servers, and get a list of all their pritners from wmi. It will | |
# then look to see which of these printers have TCP/IP printer ports. If they do, I try and grab the IP | |
# address from their hostaddress, then barring that, the port name, and the comments. Then, for each of | |
# those printers that have a matching IP address, I'll test port 80 and 443 connections to them. I choose | |
# HTTP first, simply because in my org the HTTPS are all self-signed certs (I know). I also try and use the | |
# driver name to guess at the manufacturer and assign a picture as well. | |
# Categories will be grouped by print server, duplicates can exist, and this is probably the wrong way to |
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
Add-PSSnapin Citrix.* | |
$IcoPath = "C:\Local\Google.ico" | |
$Icon = New-BrokerIcon -EncodedIconData ([convert]::ToBase64String((Get-Content $IcoPath -Encoding byte))) | |
$Params = @{ | |
AdminAddress = "ddc1" # delivery controller | |
ApplicationType = "PublishedContent" | |
Name = "Google" | |
CommandLineExecutable = "https://google.com" | |
DesktopGroup = "Applications" # Just need a delivery group with resources | |
IconUid = $Icon.Uid |