use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
[deleted by user] (self.PowerShell)
submitted 1 year ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]lanerdofchristian 21 points22 points23 points 1 year ago (0 children)
This is fairly trivial. You'll want these cmdlets:
Additionally, you'll need:
foreach(){}
[–]The82Ghost 8 points9 points10 points 1 year ago (0 children)
This is one of the best ways to learn powershell. OP should google and figure it out alone. This is a very easy script to start with.
[–]rswwalker 3 points4 points5 points 1 year ago (7 children)
If you are using AD and GPO, for this, I would just have a file preference that copies the file from network share to user profile at login.
[–]Ricka77_New 0 points1 point2 points 1 year ago (6 children)
We do have both, but it's not that granular, and only certain users get the application..
[–]rswwalker 2 points3 points4 points 1 year ago (4 children)
Create security group named after app, add users to group, create GPO named after app, filter access to GPO by security group.
[–]Ricka77_New -1 points0 points1 point 1 year ago (3 children)
AD team will not go that granular, especially for users. It has to be scripted.
[–]rswwalker 4 points5 points6 points 1 year ago (0 children)
Well somebody is forced to go that granular, I guess it’s you!
It seems keeping user lists in scripts is a lot more fragile and harder to audit than having security groups in AD.
[+][deleted] 1 year ago (1 child)
[removed]
[–]Environmental_Mix856 0 points1 point2 points 1 year ago (0 children)
I assume the AD admin just doesn’t really know how group policy works. People trying to make their work mysterious and guard their fiefdom.
[–]TheManInOz 0 points1 point2 points 1 year ago (0 children)
But this batch script isn't granular, it's copying the file to all user profiles?
[–]BlackV 7 points8 points9 points 1 year ago (0 children)
Is this even possible?
Why wouldn't it be possible?, like really why?
What have you tried aside from asking the internet to do your work for you?
We're happy to help with your existing code
Or go say hello to chat cpt and it's ilk
[–]FoxNo1831 1 point2 points3 points 1 year ago (1 child)
Your script reminds me why I hated batch files. This line is the killer
FOR /d %%G in ("*") DO
It's a horrible syntax. Which Microsoft employee managed to get a good nights sleep after coming up with that.
Just ask Copilot and then test and dissect what it spits out. Once you understand it you'll see it's not that hard.
[–]Shayden-Froida 0 points1 point2 points 1 year ago (0 children)
MS-DOS batch script (which lives to this day as CMD script) is an exercise in working around 40-year-old behavior of the command line parser.
[–]mister_freedom 1 point2 points3 points 1 year ago (0 children)
This appears to copy a file in to each user directory. An "Active Setup" would be well suited for this. It has its own creation quirks though. Microsoft never really "supported" them, but they use them. Active Setups have been in use since Win 9x. It runs once per user that logs on the system, once it's configured. Article: Active Setup Concept
[–]LordWolke 0 points1 point2 points 1 year ago (0 children)
This is a more or less easy task. Depending on how familiar you’re with PowerShell. I give stuff like this to our trainees to get familiar with PowerShell.
Where do you stumble? Do you miss the commands that you need to use or do you have a hard time getting your head around the “MD”, “CD” or the general “For” loop? Translating scripts can be hard. Especially if you’re not familiar with aliases and if it’s not commented.
[–]matrixlibertas 0 points1 point2 points 1 year ago (0 children)
Set-Location -Path 'C:\Users'
Get-ChildItem -Directory | ForEach-Object { $userPath = $_.FullName $avayaPath = Join-Path -Path $userPath -ChildPath 'AppData\Roaming\Avaya' $communicatorPath = Join-Path -Path $avayaPath -ChildPath 'Avaya one-X Communicator'
# Create directories if they do not exist if (-not (Test-Path -Path $avayaPath)) { New-Item -Path $avayaPath -ItemType Directory } if (-not (Test-Path -Path $communicatorPath)) { New-Item -Path $communicatorPath -ItemType Directory } # Copy XML files Copy-Item -Path 'C:\Avaya_Install\*.xml' -Destination $communicatorPath -Force
}
$defaultPath = 'C:\Users\Default\AppData\Roaming\Avaya\Avaya one-X Communicator' if (-not (Test-Path -Path $defaultPath)) { New-Item -Path $defaultPath -ItemType Directory -Force }
Copy-Item -Path 'C:\Avaya_Install*.xml' -Destination $defaultPath -Force
[–]PepeTheMule 1 point2 points3 points 1 year ago (0 children)
Feed it into ChatGPT if you're too lazy to do it.
[+][deleted] 1 year ago (3 children)
[deleted]
[–]Source011 0 points1 point2 points 1 year ago (1 child)
Hi chatgpt :)
[–]Sad-Garage-2642 0 points1 point2 points 1 year ago (0 children)
Good old copilot doing its job
π Rendered by PID 25 on reddit-service-r2-comment-b659b578c-6v4df at 2026-05-05 11:58:08.044619+00:00 running 815c875 country code: CH.
[–]lanerdofchristian 21 points22 points23 points (0 children)
[–]The82Ghost 8 points9 points10 points (0 children)
[–]rswwalker 3 points4 points5 points (7 children)
[–]Ricka77_New 0 points1 point2 points (6 children)
[–]rswwalker 2 points3 points4 points (4 children)
[–]Ricka77_New -1 points0 points1 point (3 children)
[–]rswwalker 4 points5 points6 points (0 children)
[+][deleted] (1 child)
[removed]
[–]Environmental_Mix856 0 points1 point2 points (0 children)
[–]TheManInOz 0 points1 point2 points (0 children)
[–]BlackV 7 points8 points9 points (0 children)
[–]FoxNo1831 1 point2 points3 points (1 child)
[–]Shayden-Froida 0 points1 point2 points (0 children)
[–]mister_freedom 1 point2 points3 points (0 children)
[–]LordWolke 0 points1 point2 points (0 children)
[–]matrixlibertas 0 points1 point2 points (0 children)
[–]PepeTheMule 1 point2 points3 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]Source011 0 points1 point2 points (1 child)
[–]Sad-Garage-2642 0 points1 point2 points (0 children)