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
$servers = Get-Content C:\temp\serverlist.txt | |
function Report-Printer { | |
param ($server = $env:computername) | |
$printers = Get-Printer -ComputerName $server | |
$drivers = Get-PrinterDriver -ComputerName $server | |
foreach ($printer in $printers) { | |
$ver = $drivers | where {$_.name -eq $printer.drivername} | select -first 1 | select -expand DriverVersion | |
$rev = $ver -band 0xffff | |
$build = ($ver -shr 16) -band 0xffff |
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
$loggedonUser = get-wmiobject -Class win32_computersystem |select username | |
$objuser = new-object System.Security.Principal.NTAccount($loggedonUser.username) | |
$userdata = $objuser.Translate([System.Security.Principal.SecurityIdentifier]) | |
Set-ItemProperty "registry::hkey_users\$($userdata.value)\Software\Microsoft\Office\16.0\Common\TargetedMessagingService\MessageMetadata\*MsgId:BizBar" -Name AppIdOnAction -Value 6 | |
Set-ItemProperty "registry::hkey_users\$($userdata.value)\Software\Microsoft\Office\16.0\Common\TargetedMessagingService\MessageMetadata\*MsgId:BizBar" -Name SetUserAction -Value 2 | |
#current user changes as admin: https://stackoverflow.com/questions/66066661/how-to-edit-hkcu-values-with-powershell#:~:text=When%20running%20an%20elevated%20PowerShell%2C%20the%20user%20specific,SID%3E....%20For%20example%3A%20Get-ItemProperty%20-Path%20%22registry%3A%3Ahkey_users%24%20%28%24strSID.Value%29SoftwarePoliciesMicrosoftWindowsControl%20PanelDesktop%22 | |
#reg settings: https://community.spiceworks.com/topic/2276 |
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 to Get Permissions on a particular on List, Folder or List Item | |
Function Get-PnPPermissions([Microsoft.SharePoint.Client.SecurableObject]$Object) | |
{ | |
#Determine the type of the object | |
Switch($Object.TypedObject.ToString()) | |
{ | |
"Microsoft.SharePoint.Client.ListItem" | |
{ | |
If($Object.FileSystemObjectType -eq "Folder") | |
{ |
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 | |
Outputs to a UTF-8-encoded file *without a BOM* (byte-order mark). | |
.DESCRIPTION | |
Mimics the most important aspects of Out-File: | |
* Input objects are sent to Out-String first. | |
* -Append allows you to append to an existing file, -NoClobber prevents | |
overwriting of an existing file. | |
* -Width allows you to specify the line width for the text representations |
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 Set-AutoAttendantAudioFile { | |
Param ( | |
$originalAudioFile = "C:\Sound recordings\Recording (8).m4a", | |
$autoAttendantName = “Teams Testing”, | |
$VLCInstall = 'C:\Program Files\VideoLAN\VLC\vlc.exe' | |
) | |
if (!(Test-Path $VLCInstall)) { | |
"Need to install VLC or specify different install directory for VLC.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
$IPs = import-csv C:\Scripts\Input\Dev_IPs_Final.csv | |
$zones = Get-DnsServerZone | |
#decided to use function instead of adding the results to an array | |
#when I did the array and tried to export to csv, it was all pissy because CSV needed objects and it kept outputting the line length | |
function Resolve-IPs{ | |
param ( | |
$IPs, | |
$zones |
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
# Description: Installs Windows Firewall Exceptions for the portable airtame.exe application. | |
# Rules will be dynamically installed for each user that is currently logged into the machine. | |
# | |
$FWRuleDisplayName = "airtame portable exe" | |
$FWRuleDescription = "airtame.exe" | |
$ProgramPath = "appdata\local\temp\airtame-portable\airtame.exe" | |
Write-Verbose -Message "Getting all firewall rules that have exceptions for: $($ProgramPath)" | |
$CurrentRules = Get-NetFirewallApplicationFilter -Program "*$ProgramPath" -PolicyStore PersistentStore -ErrorAction Ignore | Get-NetFirewallRule -ErrorAction Ignore |
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
$files= Get-childitem Y: | select -last 90 | |
function Process-RADIUSLogs () { | |
[CmdletBinding()] | |
param( | |
$file, | |
[switch]$onlyAccepted | |
) | |
if ($onlyAccepted) {Write-Verbose "Processing only authenticated attempts"} |
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 AddItemProperties($item, $properties, $output) | |
{ | |
if($item -ne $null) | |
{ | |
foreach($property in $properties) | |
{ | |
$propertyHash =$property -as [hashtable] | |
if($propertyHash -ne $null) | |
{ | |
$hashName=$propertyHash[“name”] -as [string] |
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 ConvertToMp3( $file, [string] $vlc = 'C:\Program Files\VideoLAN\VLC\vlc.exe') { | |
PROCESS { | |
$codec = 'mp3'; | |
$oldFile = Get-Item $file; | |
$newFile = $oldFile.FullName.Replace($oldFile.Extension, ".$codec"); | |
&"$vlc" -I dummy "$oldFile" ":sout=#transcode{acodec=$codec,vcodec=dummy}:standard{access=file,mux=raw,dst=$newFile}" vlc://quit | out-null; | |
#Only remove source files when you are sure that the conversion works as you want |
NewerOlder