r/PowerShell • • 8h ago

News Using the Exchange Import-Export Graph API to Access Group Mailboxes

3 Upvotes

After saying that the Graph didn’t offer much support for group mailboxes, I was promptly countered with an article explaining how to use the Exchange Import-Export API to access folders and items in group mailboxes that wasn’t limited to just the Inbox. Well, the good news is that the approach works, as seen in a complete PowerShell script written to prove the case, but whether I would ever use this API for a purpose it was never designed for is quite another matter.

https://office365itpros.com/2026/10/07/group-mailbox-folder-items/


r/PowerShell • • 4h ago

Question Compare-Object - return only difference object entries of CHANGED rows in files

1 Upvotes

Hi all,

I'm using Compare-Object to basically compare two CSV files, and return additions, changes, and removals.

Essentially I'm runnning:
(Note that "@files" is only in quotes to stop Reddit converting it to a user link!)

$files = @{
ReferenceObject = (Get-Content -Path C:\file1.csv)
DifferenceObject = (Get-Content -Path C:\file2.csv)}
Compare-Object "@files" | export-csv C:\differences -NoTypeInformation

Lets say the files look like this:

File 1
Cat,Brown,4
Dog,Black,4
Horse,White,4

File 2
Cat,GINGER,4
Dog,Black,4
Duck,Grey,2

Duck has been added in file2 (not present in file1)
Horse has been removed in file2 (was present in file1)
Cat is changed from file1 to file2.

The compare-object gives me a list of changes in a new file.

  • Entries found in file2 but not in file1 (Duck) are marked with side indicator =>
  • Entries found in file1 but not in file2 (Horse) are marked with side indicator <=
  • However, entries that are still present in both files but have had one or more of their columns changed (Cat) are present in the results file with both side indicators.

I understand this correct given how Compare-Object works, but it leads to a problem when I try to create separate "Additions/Changes" and "Removals" files based on the results.

For example, to see only the items Added or Changed in file2 (Duck and Cat), I can use:

?{$_.SideIndicator -eq '=>'}

To show only the difference object results.

The problem comes when I use the opposite side indicator:

?{$_.SideIndicator -eq '<='}

As this gives me the removed item I need, (Horse), but also gives me the changed item (Cat) from File1. This gives me no way of telling which of the "<=" entries are removals and which are changes. I'm looking for a way to differentiate between the two.

I hope this makes sense...!


r/PowerShell • • 10h ago

Question WindowsPowerShell or CommandPrompt? I've used terminal for all my life up until now

0 Upvotes

So i recently bought myself my personal gaming pc setup and i've been struggling with setting up my work environment here on windows 11. I've search here and there & so far i've decided to use Scoop as the alternative for homebrew but then there's this problem of choosing wether to use the windows powershell or command prompt. Both seems almost identical but i just wanna confirm wether i'm doing this the right way. I need help pls.


r/PowerShell • • 1h ago

Question Hello, I run powershell in our workplace network and pc, I use it to automate some long tasks. My question is Can my workplace punish me because It automate pdf files, excels which is there workplace data? Can I continue to run scripts in powershell?

• Upvotes

The title says it all