r/PowerShell • u/AutoModerator • Nov 01 '26
Script Sharing What have you done with PowerShell this month?
A sticked post for the community to share their projects throughout the month.
Make sure to post a link to the code!
r/PowerShell • u/AutoModerator • Nov 01 '26
A sticked post for the community to share their projects throughout the month.
Make sure to post a link to the code!
r/PowerShell • u/Alex_Neifar • Nov 02 '26
(rewritten due to strikes over artificial intelligence)
I use a spell checker when writing this text. Do I need to write that it is ai?
Hey dudes, hi everyone! I recently ran into an issue: I needed to change the colors in PowerShell. I tried doing it manually, but couldn't find any suitable solutions. I also found some cool programs for Linux, but they didn't work for this.
I found some good color palettes, but I couldn't find a solid solution specifically for PowerShell, so I adapted and improved one to suit my own needs. I hope it works for yours, too.
I built a small tool called StyleyShell to make changing colors in classic PowerShell and classic Windows console CMD easier (separate or together).
it can (or you with it also can be):
No admin rights needed, I think it's pretty convenient.
AND source just TWO scripts u can analyze it easy
Github: https://github.com/kolandor/StyleyShell
Hope someone finds it useful! If you like it, I'd appreciate a ⭐ on Github, or as a cool dude. Feedback here welcome, we can talk
Please be understanding and, I ask, do not issue any strikes; this article might prove useful to others. To those from the future reading this post: please have a laugh at how absurd the world once was, and at the things people were forced to justify.
r/PowerShell • u/techie211 • Oct 31 '26
Hello, I’m familiar with the basics and would like to learn more about PS. Any resources is appreciated
r/PowerShell • u/alonso0492 • Oct 31 '26
Hey everyone!
I wanted to share my first PowerShell module, PSLocalBase, a local database engine I've been working on.
The idea came from wanting a simpler way to store, manage, and query structured data in PowerShell without constantly reading and writing large JSON files or dealing with long, complex SQL queries.
I ended up building a lightweight, NoSQL-style document database on top of Windows' native SQLite engine (winsqlite3.dll), using SQLite's built-in JSON functions to handle document storage, filtering, and queries.
The goal was to combine the simplicity of working with JSON documents and collections with SQLite's performance, reliability, and ACID transactions, without requiring external dependencies or a separate database server.
Some of the features I've implemented:
PSCustomObject)Here's a quick example:
$db = [PSLocalBase]::new("./mydata.db")
$db.collection("users").doc("user1").set(@{
name = "John"
role = "Admin"
active = $true
})
$admins = $db.collection("users").
where("role", "=", "Admin").get()
$db.close()Everything runs locally, with no database server or external service required.
One of the most interesting parts of building this has been working directly with SQLite's native API through C# and P/Invoke, while keeping the interface simple for PowerShell users.
It's been a great learning experience, especially figuring out compatibility between Windows PowerShell 5.1 and PowerShell 7.
Since this is my first PowerShell module, I'd really appreciate feedback from the community, especially on the API design, performance, and potential use cases.
AI Disclosure: I used AI coding assistants throughout the development of PSLocalBase for implementation, debugging, testing, and documentation. I have over 12 years of PowerShell experience and directed the project's architecture, design, and technical decisions.
GitHub: https://github.com/cmartineztech/PSLocalBase
Thanks for checking it out!
r/PowerShell • u/GabiHanganu • Oct 30 '26
Hi everyone!
I've been working on a personal open-source project called **WinOptiKit** (v3.15). It's a lightweight Windows optimization and diagnostic utility built entirely using PowerShell and a custom modern dark-mode WPF GUI.
The main goal was to move away from messy scripts and create a clean, responsive interface that handles hardware specs reporting, dynamic app removal, startup management, and safe system maintenance (SFC/DISM wrappers) with proper elevated console handling (`-Verb RunAs`).
Here is what the tool handles under the hood:
- Custom XAML-based WPF dark theme layout with dynamic view switching.
- Hardware & Storage reporting via CIM instances.
- Dynamic AppX package scanner & uninstaller.
- Registry-based startup items manager.
- Safe execution wrappers for network flush and repair utilities.
You can check out the source code, XAML implementation, and structure on GitHub here:
👉 https://github.com/GabiHng/WinOptiKit
I'm mainly looking for constructive feedback on how I structured the WPF event handlers and PowerShell functions. Let me know what you think or if you spot any improvements!
Note: AI tools (like Gemini) were used to assist in structuring code, refactoring WPF XAML, and writing project documentation.
r/PowerShell • u/nyxvren • Oct 30 '26
I’m setting up a PowerShell 7 environment on Windows and using Windows Terminal, Oh My Posh, and PSFzf.
I want a useful prompt and better command history, but I don’t want every new terminal tab to load a long list of modules.
The basic setup I’m considering looks like this:
oh-my-posh init pwsh | Invoke-Expression
Import-Module PSFzf
Would you put both directly in $PROFILE, or keep the profile minimal and load some tools only when needed?
Have you noticed a meaningful difference in startup time? I’d be interested in seeing how you organize your profiles in practice.
r/PowerShell • u/CelebrationAnxious40 • Oct 29 '26
What are people actually getting paid to do with PowerShell these days?
I'm genuinely curious what people in this sub are doing with PowerShell professionally, particularly those who've found interesting or lucrative niches.
I'm fluent in PowerShell and love it for rapid prototyping, exploring unfamiliar APIs, discovering how services work, and building CLI tooling quickly. Its cross-platform capabilities are great, and the tooling, packaging, and module ecosystem are hard to beat compared to something like Python.
Historically, I've done a lot of operational automation: ticket ninjaing, reporting, and gluing enterprise systems together. But as I've moved toward higher-level engineering, I find myself reaching for other languages once projects grow beyond scripts.
AI makes generating decent-to-great sysadmin cmdlets almost trivial now. But when you start building platforms around those scripts, exposing them through APIs, abstracting execution for other users, or orchestrating workflows, I often find myself wondering why I didn't just build the whole thing in another language from the start.
I'm not saying PowerShell can't do those things. I'm curious where people are finding its real value in the market.
A few things I'd love to hear about:
I'm genuinely curious what people are getting paid to solve with PowerShell beyond the usual enterprise and small-business automation, reporting, and cleanup work. Not knocking that stuff; I've done plenty of it myself, hell if there is a massive market for it I'd love to hear that too. Just wondering what else is out there.
r/PowerShell • u/putanaspace • Oct 29 '26
I'm currently using Windows and learning PowerShell with Learn PowerShell in a Month of Lunches, Fourth Edition. I'm about halfway through the book, and honestly, I'm really enjoying PowerShell so far. I find it much more intuitive and enjoyable to work with than Bash.
I'm considering using PowerShell on Linux as well, but I'm wondering how practical that would be.
I'd appreciate hearing from people who actually use PowerShell on Linux. Is it worth going down this path, or am I making things unnecessarily complicated?
r/PowerShell • u/lan-shark • Oct 28 '26
I saw a comment on here earlier today about VS Code's syntax highlighting for PowerShell not being able to properly color PowerShell 7's null operators: ??, ??=, ?., and ?[]. I had never noticed this before because I've never even tried to do that, but it turns out that there is not built-in tokenization for these operators despite a 7 year old issue on the topic. I'd never written a VS Code extension before and this seemed like a fairly easy first task, so I wrote a small MIT-licensed extension that allows you to add syntax highlighting to these operators. Source code on GitHub here, install it from the VS Marketplace here.
Was pretty fun to build, though I don't know how practical it'll be for me since I use pretty minimal syntax highlighting personally. But I got to learn how to build and publish a VS Code extension and I'm considering tackling that GitHub issue and getting this functionality into the official highlighter. No promises though lol
I did use an LLM to help me find documentation, fix some errors in my JSON, and remind me how to write regex lookbehinds. I didn't use any agent system to write or publish the extension or documentation for me.
r/PowerShell • u/Unfair_Nose_1745 • Oct 29 '26
Hello everyone, I hope you’re having a good day. I’ve been dealing with an issue for a while now: three types of notifications (from Qualcomm, HP, and Adobe) keep appearing—notifications that definitely don’t relate to anything I have installed on my laptop (an Asus). They use Windows PowerShell and present themselves as certificates claiming to represent the companies I mentioned. It’s quite frustrating; I get 2 or 3 windows popping up, all asking for the same thing. At one point, about 30 windows appeared at once, which caused my laptop to freeze up. Sometimes, a window will appear for just 2 or 3 seconds and then vanish. These are very bothersome, as they cause my video games to freeze whenever I try to play. Do you know how I can fix this? Thank you so much!
P.D: I would like to attach an image, but the platform doesn’t allow it; apologies for not being able to show you a visual example.
r/PowerShell • u/ProfileSweep • Oct 29 '26
AI disclosure: I used an AI assistant (Claude) to help review my script and tidy up this post. The testing and findings are from my own machines.
I look after a pool of loaner laptops and meeting-room PCs. Each machine ends up with dozens of stale profiles, and disks fill up fast. Here's what I learned automating the cleanup:
1. Don't just delete C:\Users\<name>. The registry entry under ProfileList stays behind, and the next login gets a temporary profile. Remove the profile properly through Win32_UserProfile.
2. LastUseTime lies. AV scans and services touch profiles and update it. I even saw it update on a profile whose account no longer exists.
3. Check Robocopy exit codes. 0-7 count as success, and 8 or above means failure. Verify the backup before you delete anything.
4. Skip loaded profiles, special accounts and your own admin account. Sounds obvious until a scheduled task runs while someone is logged in.
5. Two profile records can point at the same folder. On my test machine, a deleted-and-recreated account left an orphaned SID still pointing at C:\Users\<admin>, the same folder the logged-in admin was using. A naive "remove every unloaded profile" would have wiped the live admin's folder. Now I skip any record whose LocalPath is shared with a loaded profile:
$profiles = Get-CimInstance Win32_UserProfile | Where-Object { -not $_.Special -and $_.LocalPath -like 'C:\Users\*' }
$loadedPaths = ($profiles | Where-Object Loaded).LocalPath
$profiles | Where-Object { -not $_.Loaded -and $_.LocalPath -notin $loadedPaths } |
Remove-CimInstance -WhatIfHow do you handle this? GPO "delete profiles older than X days", DelProf2, or something custom?
r/PowerShell • u/Beneficial_Ad6263 • Oct 29 '26
A console cannot paste a picture. I wanted Win+Shift+S, then Ctrl+V, to type a file path the CLI can open.
The helper listens for Ctrl+V while Windows Terminal, PowerShell, or CMD is in front. It saves the clipboard image as a JPEG and types the path, for example C:\ToSnip\a1b2c3.jpg. The file stays on this PC. It is not uploaded. It is deleted after 5 minutes.
Install once:
irm https://tosnip.com/install.ps1 | iex
Read it before you run it. The source is MIT:
https://github.com/tana360/tosnip/blob/main/public/install.ps1
https://github.com/tana360/tosnip/blob/main/public/tosnip-paste.ps1
I built this. There is also a browser page at https://tosnip.com/web/ that makes a link instead of a local path. That link expires after 5 minutes too.
r/PowerShell • u/ParsleyLopsided2454 • Oct 29 '26
Been working on a PowerShell script for shutting off the Windows/app telemetry settings I could actually document.
Repo is here: https://github.com/quinnted/schizo
It keeps the rules in .psd1 files, journals the old state before changing anything, and has a separate restore script. Runs on 5.1 and 7.
I've tested the full apply/restore cycle in 26H2 Home/Pro VMs and now on my own 25H2 Home machine. 266 Pester tests currently pass on both PS versions.
plz test it and critique it https://github.com/quinnted/schizo/issues/1
Some of the code was written with Claude Code. I created all the architecture, and this wasn't oneshotted slop.
r/PowerShell • u/Rosjkor • Oct 28 '26
Hi everyone, I'm feeling a bit anxious and need some reassurance.
I recently ran these two commands in PowerShell/CMD:
I didn't download anything from the internet or run any external scripts, but now I'm overthinking and worrying if these built-in commands could somehow connect to the internet, download a stealer, or compromise my Steam account.
Can these native Windows commands access the web or steal data on their own, or are they completely local and safe? I already ran a Malwarebytes scan and it came back clean, but my anxiety is acting up. Thanks for any clarification!
Used Ai because I am not very good at English
r/PowerShell • u/Intelligent-Pay-4398 • Oct 27 '26
Hey All,
Does anyone have any experience with InstallAnywhere installers? Weve got some agent upgrades to do, and during our pilot group we ran into some strange failures. We tried to setup logging, but were pretty crunched for time so decided it was a next week problem.
The issue weve found is that InstallAnywhere doesnt advertise its processes the same way an MSI does, so you have to do some janky stuff.
Ive tried passing -RedirectStandardOutput and StandardError to a log file, but theyre either empty, or dont generate at all.
If anyone has any advice or any documentation they can point to thatd be awesome.
Thanks!
r/PowerShell • u/Ill_Cantaloupe9191 • Oct 27 '26
I rebuild AD labs a lot, and I got tired of the lab build taking longer than the thing I actually wanted to test. So I wrote build-lab.
It takes a Windows Server 2025 ISO and gives you back a promoted domain controller, optional domain-joined member servers, and a lived-in directory (OUs, users, groups, an Enterprise CA, GPOs) staged to populate itself at your first Administrator logon. No GUI, no answer-file editing, no clicking Next. Nothing to install beyond what Microsoft and VMware already ship.
It's an orchestrator. It drives two sibling projects of mine, one that builds the VM in VMware Workstation and one that promotes the forest and populates the directory, and stitches them together over vmrun guest operations. The current version is 2.0. It has been on GitHub for a while, but this is the first time I've posted it here.
Quick start
$pw = ConvertTo-SecureString 'P@ssw0rd!' -AsPlainText -Force
.\build-lab.ps1 -IsoPath 'C:\ISOs\WS2025.iso' -AdminPassword $pw `
-VmStoragePath 'C:\VMs' -StaticIpAddress '192.168.220.50' -DefaultGateway '192.168.220.2' `
-MemberServerCount 2That builds the DC, verifies the promotion, then builds SRVR-01 and SRVR-02 and joins them. (Leave -AdminPassword off the command line and PowerShell will prompt for it masked, which keeps it out of your history.) On the default VMware NAT network, your static IP has to land in .3 to .127 and the gateway is always .2. The script refuses anything outside that range and pings every address before using it. A DC takes about 25 minutes on a reasonably quick host, and each member adds roughly 12 to 15.
Already have a DC from an earlier run? -AddMemberServers adds members to it without touching the DC. -MoveMemberServers files them into OU=Servers once directory population has created it.
The fun part
Promotion reboots the guest, and the reboot tears down the vmrun guest-operations channel mid-call. A blocking call hung across that reboot and never came back, so the promotion is launched fire-and-forget with -noWait. That means there is no exit code to read at all.
My first version decided promotion had worked when ntds.dit appeared on disk, waited a bit, and called it good. Typical v1.0 logic. A database file on disk is a long way from a working DC. Now it checks three things from the outside, in order. ntds.dit has to appear. The guest has to reboot. Then the rebooted guest has to report itself as a DC in the domain you configured. Miss any of them and the run fails and tells you which check it missed.
The reboot check is the bit I'd like opinions on. Just before launching anything that should reboot, build-lab creates HKLM\SOFTWARE\BuildLabBootMarker in the guest as a volatile key. Volatile keys live only in memory and are never written to disk, so if the key is gone, the guest restarted. That holds however long the guest has been up, which mattered here. A freshly built member reboots for its domain join barely a minute after first boot, and anything uptime-based gets confused.
A few other things that came out of live runs.
Known limitations and lab-grade trades
#Requires. Write-EventLog is the right API there and deprecated in 7. I'll probably port to PowerShell 7 eventually, but this is where I' most comfortable today.Links
All three need to sit next to each other on disk. Feedback is welcome. I'm sure I made some interesting choices without even thinking about it. If you have a better way to tell from the host side that a guest has restarted, I'd like to hear it.
AI disclosure
I used AI to help write some of the code. The design and architecture are all mine, including any questionable choices, and it was built up over many reviews and live runs, not generated as one shot slop.
r/PowerShell • u/Unlikely_Tie1172 • Oct 27 '26
Investigating the work necessary to convert PowerShell scripts based on the Search-UnifiedAuditLog cmdlet to use the AuditLogQuery Graph API shows that it’s not easy. Running audit jobs is a multi-stage process rather than running a simple cmdlet. Parameter values are now passed in a request body or different named parameters, and the properties output in the AuditData payload use a different format. This is definitely not a drop-in exercise, so it’s time to get ready by finding scripts that need to be converted.
https://office365itpros.com/2026/10/27/auditlogquery-conversion/
r/PowerShell • u/jstar77 • Oct 26 '26
I really don't like VS Code for Powershell but PS 5.1 and PS ISE is starting to get long in the tooth. Anybody have tips, tricks, custom configs, or other recommendations?
Funny enough I really like VS code for everything else except PowerShell.
r/PowerShell • u/Scylenthum • Oct 26 '26
So I discovered how useful Powershell is about 3 weeks ago and have been playing with it and tweaking my PC with all manner of useless changes. I have reached something that has left me rather stumped even after a fair bit of Googling (AI results disclosure?) and several hundred changes of my 'script'. Posting here is probably like whacking a mole with a warhead but hey why not!
I have been attempting to change a subtitle file with several thousands of lines of text, they all follow the following pattern:
Dialogue: 0,0:00:12.92,0:00:17.34,Default,,0000,0000,0000,,{\pos(540*,420)}Hello world!\N*
I would like to add 140 to all of the first numbers after "{\pos(" (e.g 540 becomes 680.)
Dialogue: 0,0:00:12.92,0:00:17.34,Default,,0000,0000,0000,,{\pos(680*,420)}Hello world!\N*
I have been attempting to do this by loading the .ass text file in (this'll be part of a batch file so I am calling Powershell from CMD), then using the -replace function as follows:
powershell -Command "((Get-Content -path <path to sub.ass> -Raw) -replace '\{\\pos\(\d+,','\{\pos\(${140 + \d+},') | Set-Content -Path <path to sub.ass>"
However this results in the following results for all lines of dialogue:
Dialogue: 0,0:00:12.92,0:00:17.34,Default,,0000,0000,0000,,\{\pos\(,420)}Hello world!\N
This is one of the more promising results where {140 + \d+} simply vanished. Without the $ in front of {140 + \d+} Powershell will simply repeat whatever code I put into into it back at me in place of \d+ like so: {\pos\({140 + \d+},420)}
I suspect that because I am attempting to isolate a number by using the surrounding punctuation the program is reading \d+ as a string rather than an integer.
TLDR: I am attempting to increase the value of the same integer on every line of text by 140 using \d+. \d+ could be any number from 0 to 1540. Not using \d+ is fine but I have no idea what other options are available.
Pointing me in the direction of what I should learn to get this to work could also be great as this is actually a pretty enjoyable program - I just think I went a little too deep too fast with this one.
r/PowerShell • u/AccomplishedMeet628 • Oct 25 '26
After a month of refinement, I have a new version of my App in the MS Store.
I received some feedback and a lot suggestions, plus more than a few bug issues.
It is now more like a true PowerShell console than the emulator it was before. There should not be any more unrecognized PS commands. It is still a WIP but it is definitely close to a Daily Driver for running scripts and debugging.
I actually prefer it now than opening a PWSH console.
The debugging sub-system has been hardened and more responsive. I am adding output options to make automated script running easier. The save as EXE works, I am going to be adding .NET level options to the executable next.
Once again. If anyone would like to give it a try and provide feedback, it is most welcome.
It can be found by searching for PS7ScriptDesk in the MS store.
Regards,
-Ron
r/PowerShell • u/Acceptable_Issue_272 • Oct 22 '26
Hi everyone,
I’m currently learning PowerShell with Microsoft Graph because my goal is to become a Junior IAM / Microsoft Entra ID Administrator.
I’ve been practising in my own Microsoft Entra ID lab, and so far I’ve managed to learn some basics, such as:
1)Connecting to Microsoft Graph using PowerShell
2)Creating, updating and deleting users
3)Creating and managing security groups
4)Adding and removing users from groups
5)Retrieving and filtering users
6)Working with variables, arrays, hashtables and loops
However, I’m starting to struggle and slowly losing interest, not because I don’t want to learn, but because sometimes I feel like I’m just memorising commands without fully understanding how to use them in real-world situations.
I can follow tutorials and complete exercises, but when I try to do something on my own, I sometimes get stuck and don’t know which commands to use or where to start.
My goal isn’t just to memorise PowerShell commands. I want to understand how an IAM administrator actually uses Microsoft Graph PowerShell in their daily job.
For those of you who learned PowerShell, especially for Microsoft Entra ID or IAM:
How did you learn PowerShell and become confident using it?
Did you learn the general PowerShell fundamentals first, or did you learn while working with Microsoft Graph?
What practical projects or exercises helped you the most?
How do you remember commands and know which ones to use when solving a problem?
What would you recommend to someone preparing for their first Junior IAM Administrator role?
I’m willing to put in the time and effort. I just feel like I need a better learning approach that will help me understand what I’m doing instead of simply following instructions.
Any advice, learning resources or personal experiences would be greatly appreciated.
Thanks in advance!
r/PowerShell • u/FastFredNL • Oct 22 '26
Ok, I need some help with Powershell.
Part of our company got sold. This weekend, the migration is set to go through. All users that are part of this transfer will login into the new owners IT infrastructure and their 365 tenant starting next monday. The mailbox contents will be synced and for the next few weeks all incoming e-mail needs to be auto-forwarded to the user's new mailbox in the other tenant. And a auto-reply will be sent to the sender informing them of the upcoming discontinuation of the old e-mail address.
So, all e-mail coming in to 'olduser' needs to be forwarded to 'newuser' and newuser is in another tenant. To prevent double e-mail, 'olduser' should not be seeing the e-mail in their inbox.
Currently this is what I have, being run from Exchange Management shell connected to Exchange Online
$Users = Import-Csv "c:\temp\usermailboxentest.csv" -delimiter ";"
foreach ($User in $Users) {
Set-Mailbox -Identity $User.adresold `
-ForwardingSmtpAddress $User.adresnew `
-DeliverToMailboxAndForward $false
}And then, I run this
$CsvPath = "C:\Temp\mailboxes.csv"
$StartTime = Get-Date
$EndTime = [datetime]::new(2026, 12, 30, 23, 59, 59)
$Results = foreach ($CsvUser in Import-Csv -Path $CsvPath) {
$MailboxAddress = $CsvUser.MailboxAddress.Trim()
try {
Write-Host "Processing: $MailboxAddress" -ForegroundColor Cyan
# Retrieve the mailbox
$Mailbox = Get-Mailbox -Identity $MailboxAddress -ErrorAction Stop
# Determine the configured forwarding address
if ($Mailbox.ForwardingSmtpAddress) {
# Forwarding to an SMTP address
$ForwardAddress = $Mailbox.ForwardingSmtpAddress.ToString() `
-replace '(?i)^smtp:', ''
}
elseif ($Mailbox.ForwardingAddress) {
# Forwarding to an internal Exchange recipient
$ForwardRecipient = Get-Recipient `
-Identity $Mailbox.ForwardingAddress `
-ErrorAction Stop
$ForwardAddress = $ForwardRecipient.PrimarySmtpAddress.ToString()
}
else {
throw "No mailbox-level forwarding address is configured."
}
Write-Host "Forwarding address: $ForwardAddress" -ForegroundColor Green
# Create the HTML automatic-reply message
$AutoReplyMessage = @"
<p><strong>Dear Sender,</strong></p>
<p>
This email address has been discontinued etc. etc etc. and a variable for $ForwardAddress pointing the user to whatever the new e-mail address is.
</p>
"@
# Configure automatic replies for internal and external senders
Set-MailboxAutoReplyConfiguration `
-Identity $MailboxAddress `
-AutoReplyState Scheduled `
-StartTime $StartTime `
-EndTime $EndTime `
-InternalMessage $AutoReplyMessage `
-ExternalMessage $AutoReplyMessage `
-ExternalAudience All `
-ErrorAction Stop
Write-Host "Automatic reply configured successfully." -ForegroundColor Green
[PSCustomObject]@{
MailboxAddress = $MailboxAddress
ForwardAddress = $ForwardAddress
Status = "Success"
Error = ""
}
}
catch {
Write-Warning "Failed for $MailboxAddress`: $($_.Exception.Message)"
[PSCustomObject]@{
MailboxAddress = $MailboxAddress
ForwardAddress = $null
Status = "Failed"
Error = $_.Exception.Message
}
}
}
# Show the results
$Results | Format-Table -AutoSize
# Export a processing report
$Results | Export-Csv `
-Path "C:\Temp\AutoReplyResults.csv" `
-NoTypeInformation `
-Encoding UTF8Now this is what happens, when I set DeliverToMailboxAndForward to $true, the autoreply works but the original e-mail is put into the old mailbox which I don't want to happen because in the new tenant users will end up with double e-mail because of the sync of mailbox contents.
When I set that to $false however, the autoreply doesn't work because 'olduser' mailbox is never 'hit'
Also, this will be for about 170 mailboxes, both user and shared boxes.
r/PowerShell • u/DeVineDesigns • Oct 22 '26
OK So this is going to sound crazy (kinda?) and I understand it is likely not an option based on what I know of the underlying application after nearly 10 years of working with it. I am hoping that someone in the wider world of Reddit has already come across a solution and is willing to share.
We (the company I work for) support a tax prep/accounting firm that has 2 RDS servers that are used to access accountant copies of QuickBooks Company Files. They use a variety of application versions from 2021 to 2024 (Accountant, Premier, and Enterprise distributions). During tax season, they are incredibly busy and as a result, have asked us to schedule application updates every Thursday evening along with updating their Thompson Reuters applications.
Personally, I don't like taking a couple hours out of my day when I'm on call to work after 7PM to update QuickBooks since they use all the versions depending on the client they are prepping taxes for. I am also in charge of making manual tasks automated wherever possible.
So, here's what I am looking to accomplish:
Here are the things I am already well aware of so don't comment if you feel the need to point out the below facts:
Please let me know if you have come across this issue and/or have found a solution that you are willing to share with me via github or other sharing platform. If you are not authorized to share this info, please don't.
I would also appreciate any scripts be coded in either a batch file or (preferably) a powershell script. :) Thanks in advance!
r/PowerShell • u/Kodama_Keeper • Oct 22 '26
Edit: To everyone who responded. You've given me some good ideas, and now I have to experiment to track down where the issue lies. Thanks to all.
I have a workflow which takes a comma delimited text file (*.txt) and updates an Azure database with the values. The workflow is called by a PowerShell script on a remote Windows Server, which looks to a folder and finds all the txt files in there, and runs the workflow against each one. This process worked fine for about two years. Then last spring, I started getting reports from our users that not all the values that should be updated in the database where. No one changed the workflow, and no one changed the PowerShell script.
After a lot of testing, we found that if the txt file was larger than 2K, only the first 2K worth of lines in the file were processed, and everything after was ignored.
On the suggestion of a consultant, he had me run the PowerShell script which calls the workflow from my own laptop. Yes, I had to duplicate the folder structure to make that happen. Much to my surprise, running the script and workflow from my laptop worked just fine.
So I started looking into what in the environment of the Windows Server would limit the ability to pass all the necessary data to the workflow. Of course our server teams swears they did nothing to the server, no updates that would cause this restriction. But I don't trust them to know what the consequences of their actions would be.
After half a year of cutting the text file down into 2K chunks every week (I automated the process, but still), I am again trying to find what the cause of this could be. Script works fine on my laptop, but choaks at 2K file size when run on a Windows Server. The server is more than powerful enough in terms of memory, processor and disk size.
If you have any clue, please pass it on.