# Scripting & Programming

**URL:** https://community.itbible.org/c/off-topic-miscellaneous/scripting-programming/48.md

[Latest](https://community.itbible.org/latest.md) · [Categories](https://community.itbible.org/categories.md) · [Tags](https://community.itbible.org/tags.md)

---

## [About the Scripting & Programming category](https://community.itbible.org/t/about-the-scripting-programming-category/139)

<div class="topic-metadata">

**Author:** [@system](https://community.itbible.org/u/system)\
**Replies:** 0\
**Last updated:** [May 2, 2025, 5:18am UTC](https://community.itbible.org/t/about-the-scripting-programming-category/139 "2025-05-02T05:18:47Z")

</div>

Writing code to create software, automate tasks, or perform data analysis.

---

## [Run Exe from Web](https://community.itbible.org/t/run-exe-from-web/147)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [September 23, 2022, 7:25pm UTC](https://community.itbible.org/t/run-exe-from-web/147 "2022-09-23T19:25:05Z")

</div>

So there are times that you may need to run an exe across many devices, and maybe those devices are across several organizations or not on a Windows Domain. With this script you can upload the file to a central web serve…

---

## [Clear Print Jobs](https://community.itbible.org/t/clear-print-jobs/160)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [September 24, 2022, 8:32am UTC](https://community.itbible.org/t/clear-print-jobs/160 "2022-09-24T08:32:17Z")

</div>

Have you ever wanted to run a script that would just clear the user’s errored print queue? With this you can put it in your RMM and have it run against a users machine and the print server (so it clears out anything that…

---

## [Hard Link AD Sync User](https://community.itbible.org/t/hard-link-ad-sync-user/249)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [October 21, 2022, 1:18am UTC](https://community.itbible.org/t/hard-link-ad-sync-user/249 "2022-10-21T01:18:07Z")

</div>

The process of hard linking AD objects to AAD objects for when you get errors during an AD Sync. On the domain controller run: Get-ADUser username | Select-Object UserPrincipalName, objectGUID, @{Name = 'ImmutableID'; …

---

## [Clear Stuck Print Jobs](https://community.itbible.org/t/clear-stuck-print-jobs/271)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 1\
**Last updated:** [December 10, 2022, 6:41am UTC](https://community.itbible.org/t/clear-stuck-print-jobs/271 "2022-12-10T06:41:16Z")

</div>

Just a way to clear print jobs that may be stuck “printing” or if they are in error status. $PrintJobs = get-wmiobject -class "Win32\_PrintJob" -namespace "root\\CIMV2" -computername "." foreach ($job in $PrintJobs) { …

---

## [Get process that is holding a port open](https://community.itbible.org/t/get-process-that-is-holding-a-port-open/231)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 1\
**Last updated:** [December 10, 2022, 7:11am UTC](https://community.itbible.org/t/get-process-that-is-holding-a-port-open/231 "2022-12-10T07:11:46Z")

</div>

Pretty simple script that will answer to what process is using a port. param( \[Parameter(Mandatory=$true)\] \[string\]$port #e.g. 443 ) # Pull PID from TCP Connections and then outputs process name(s) $pids = (Ge…

---

## [General Network Diagnostics](https://community.itbible.org/t/general-network-diagnostics/348)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [December 11, 2022, 5:05am UTC](https://community.itbible.org/t/general-network-diagnostics/348 "2022-12-11T05:05:15Z")

</div>

I wanted a way to standardize the tests that our techs run when troubleshooting network issues. I’ve started this script as a beginning though I intend for it to be an EXE in the long run. \<# .NOTES ==========…

---

## [Delete files older than x amount of days from Downloads](https://community.itbible.org/t/delete-files-older-than-x-amount-of-days-from-downloads/737)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [April 15, 2023, 8:38pm UTC](https://community.itbible.org/t/delete-files-older-than-x-amount-of-days-from-downloads/737 "2023-04-15T20:38:20Z")

</div>

Pretty simple script, this just remove files from your downloads folder that are older than x amount of days (by default its set to 60). $Paths = @( "%userprofile%\\Downloads\\" ) $Days = 60 $limit = (Get-Date).AddDa…

---

## [Execution Policy & Profile Impact](https://community.itbible.org/t/execution-policy-profile-impact/722)

<div class="topic-metadata">

**Author:** [@Andy](https://community.itbible.org/u/Andy)\
**Replies:** 0\
**Last updated:** [April 11, 2023, 6:12pm UTC](https://community.itbible.org/t/execution-policy-profile-impact/722 "2023-04-11T18:12:48Z")

</div>

After writing about prompt customizations, I realized that I likely need to address a common issue that pops up when users are first configuring their PowerShell (PS) environment. If you have not read that post yet, I wo…

---

## [Dell Open Manage](https://community.itbible.org/t/dell-open-manage/149)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [September 23, 2022, 7:32pm UTC](https://community.itbible.org/t/dell-open-manage/149 "2022-09-23T19:32:21Z")

</div>

The base for each of these snippets were written over at CyberDrain and I’ve modified them for running other commands / providing the output that we need. Battery Status This will return an error if something is wrong o…

---

## [StorCLI Status Check](https://community.itbible.org/t/storcli-status-check/150)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [September 23, 2022, 7:35pm UTC](https://community.itbible.org/t/storcli-status-check/150 "2022-09-23T19:35:54Z")

</div>

Battery Status This will return an error if something is wrong otherwise it will return “Healthy.” param( \[string\]$StorCLILocation = 'C:\\Program Files (x86)\\MegaRAID Storage Manager\\StorCLI.exe', # Path to StorCLI …

---

## [MSP-Tools](https://community.itbible.org/t/msp-tools/1529)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [September 15, 2024, 4:08pm UTC](https://community.itbible.org/t/msp-tools/1529 "2024-09-15T16:08:25Z")

</div>

So I started a project yesterday that a similar version helps us internally at my company do some tasks. My first set of commits was specifically to enable our clients the ability to send us some encrypted information, t…

---

## [Fix VSS Writers](https://community.itbible.org/t/fix-vss-writers/812)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [May 16, 2023, 4:56pm UTC](https://community.itbible.org/t/fix-vss-writers/812 "2023-05-16T16:56:47Z")

</div>

Something that we run into with VSS Writers fairly often is them being errored out and this script seems to fix them almost every time. I can’t remember where I found the bulk of this but I think this is a mashup of a fe…

---

## [Customizing PowerShell Prompt & Profile Tips](https://community.itbible.org/t/customizing-powershell-prompt-profile-tips/720)

<div class="topic-metadata">

**Author:** [@Andy](https://community.itbible.org/u/Andy)\
**Replies:** 0\
**Last updated:** [April 11, 2023, 4:43pm UTC](https://community.itbible.org/t/customizing-powershell-prompt-profile-tips/720 "2023-04-11T16:43:28Z")

</div>

I have a thing about command line prompts. I like tweaking and customizing. The prompt is such a simple thing, but impacts experience dramatically. Once I learned about prompt customization, I found a general format that…

---

## [Create URL Shortcuts](https://community.itbible.org/t/create-url-shortcuts/455)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [February 13, 2023, 6:20am UTC](https://community.itbible.org/t/create-url-shortcuts/455 "2023-02-13T06:20:37Z")

</div>

Just a quick script on creating URL Shortcuts, defaults to the Public user desktop and has support for custom icons. param ( \[string\]$Path, \[Parameter(Mandatory=$true)\] \[string\]$Name, \[Parameter(Mandator…

---

## [Enable AD Recycle Bin](https://community.itbible.org/t/enable-ad-recycle-bin/399)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [January 12, 2023, 5:47pm UTC](https://community.itbible.org/t/enable-ad-recycle-bin/399 "2023-01-12T17:47:45Z")

</div>

This was quick and dirty / probably needs some more work I’ll add it to GitHub later. Import-Module ActiveDirectory if ((Get-ADOptionalFeature -Identity 'Recycle Bin Feature').EnabledScopes) { Write-Host "AD Recycl…

---

## [Microsoft365 - Check users without litigation hold being enabled.](https://community.itbible.org/t/microsoft365-check-users-without-litigation-hold-being-enabled/226)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [October 11, 2022, 1:15pm UTC](https://community.itbible.org/t/microsoft365-check-users-without-litigation-hold-being-enabled/226 "2022-10-11T13:15:25Z")

</div>

This is a pretty simple one, but it gives you a list of users where litigation hold is not enbaled. Connect-ExchangeOnline -UserPrincipalName \<global-admin-account\> Get-Mailbox | Where-Object { $\_.LitigationHoldEnabled …

---

## [Check Application Version](https://community.itbible.org/t/check-application-version/224)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [October 10, 2022, 4:46pm UTC](https://community.itbible.org/t/check-application-version/224 "2022-10-10T16:46:14Z")

</div>

Simple way to get the version of an application via PowerShell. Param( \[Parameter(Mandatory=$true)\] $ApplicationName ) $InstalledSoftware = Get-ChildItem "HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninsta…

---

## [Restart Straight to BIOS?!?](https://community.itbible.org/t/restart-straight-to-bios/220)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [October 8, 2022, 8:06pm UTC](https://community.itbible.org/t/restart-straight-to-bios/220 "2022-10-08T20:06:13Z")

</div>

Did you know in Windows you can restart directly to the BIOS? shutdown /r /fw /f /t 0 Learn something new every day.

---

## [Enable Wake On Lan](https://community.itbible.org/t/enable-wake-on-lan/158)

<div class="topic-metadata">

**Author:** [@WizardTux](https://community.itbible.org/u/WizardTux)\
**Replies:** 0\
**Last updated:** [September 23, 2022, 7:43pm UTC](https://community.itbible.org/t/enable-wake-on-lan/158 "2022-09-23T19:43:28Z")

</div>

Someone asked me for this (I didn’t write it). \[CODE\]'\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* '\* VBS Script to: '\* Enable/Disable showing the icon in your system tray for connected NIC…
