|
So you have a hashtable like this?code:
code:
|
# ¿ Apr 29, 2020 19:17 |
|
|
# ¿ May 14, 2024 03:27 |
|
A single command won't do it, but two commands piped together willcode:
Also, if you have more than 1000 mailboxes, you will want to specify ResultSize https://docs.microsoft.com/en-us/powershell/module/exchange/get-mailbox?view=exchange-ps https://docs.microsoft.com/en-us/powershell/module/exchange/get-recipientpermission?view=exchange-ps
|
# ¿ Jul 10, 2020 16:57 |
|
Get-RecipientPermission should only work for SendAs permissions. If you are checking for other permissions, you would use Get-MailboxPermission
|
# ¿ Jul 10, 2020 18:40 |
|
I suppose I assumed and did not ask. Get-RecipientPermission is O365 only and will not work with on-prem exchange.
|
# ¿ Jul 10, 2020 18:50 |
|
A quick google found me this: https://www.beaming.co.uk/knowledge-base/powershell-commands-view-mailbox-permissions-migrating-exchange-server/ Where you need to query ad extended permissions to get what you're looking for. Not something I've ever tried to do though.
|
# ¿ Jul 10, 2020 18:55 |
|
Irritated Goat posted:I'm trying to make my scripts more "sharable" in the sense that it isn't calling for a specific named server\ip address. If I was doing somthing like The first solution I can thought of is to setup a cname for your script to point to, but then someone needs to maintain the cname record. DNS load balancer might work too. Another solution would be to maintain a list of servers in a csv or json file, then reference that in your scripts. Or you could of course just make the person running your script specify the server at run time. quote:After that, I get to figure out the best way to deal with timeouts on VPN for AD queries cause you can control timeout values in ad, otherwise reduce the size of the dataset you're querying in one go. I think most of the get-ad cmdlets support pagesize
|
# ¿ Sep 9, 2020 14:41 |
|
Yes. Get-Aduser to get your list of users, iterate through, then set-aduser. Iirc, the manager field needs to be a distinguished name or an ad object
|
# ¿ Oct 23, 2020 18:05 |
|
MJP posted:Got what is probably a dumb variable passing question. more like this: code:
ForEach will iterate over your file object, processing each row. You access the columns as properties of the row object. The Fool fucked around with this message at 17:18 on Nov 19, 2020 |
# ¿ Nov 19, 2020 17:15 |
|
MJP posted:Thanks tons! Just realized I now have to do this per subscription, and give them unique names, so now I need to run select-azsubscription -subscriptionName %subscription name goes here% and then run the new-AzSubscriptionDeployment script D: Not testing this, but I don't think inlining the string works in that situation. You could do this: code:
code:
|
# ¿ Nov 19, 2020 18:33 |
|
MJP posted:No luck - + isn't accepted as a positional parameter for New-AzSubscriptionDeployment. It looks like you may indeed be right about inlining. Actually, mystes is right and I forgot parentheses in that example code:
|
# ¿ Nov 19, 2020 20:38 |
|
Powershell should only unpack single element (and zero element) arrays in the pipeline. If you pass your array as an argument you shouldn’t have this problem.
|
# ¿ Mar 10, 2021 23:42 |
|
I mean, it works but will create an object array where each element is a line of the text results of the command
|
# ¿ Jun 21, 2021 19:57 |
|
Get stuff organized into repos ASAP. If your org is already on bitbucket it’s probably fine but Azure devops is free for 5 users and you’ll get some lightweight project management, repos, and pipelines. Azure devops pipelines work amazingly well as task runners.
|
# ¿ Jun 24, 2021 03:59 |
|
Iirc there some potential problems with a max process count E: check MaxProcessesPerShell and see if you’re hitting it
|
# ¿ Nov 22, 2021 05:26 |
|
Of you absolutely must solve this problem yourself with code use Python+pandas instead of powershell There might be a higher learning curve if you’ve never used it before but it is purpose built for solving these kinds of problems
|
# ¿ Feb 6, 2022 20:46 |
|
bare bones phone posting:code:
|
# ¿ Mar 11, 2022 20:11 |
|
it's called a hashtable
|
# ¿ Mar 11, 2022 20:15 |
|
Of the top of my head I see two issues: -match works on strings, $payload is an array of strings $Matches isn't getting set anywhere, so I'm not sure what you expect its value to be.
|
# ¿ Aug 10, 2022 19:17 |
|
To solve the first issue, I would do something like this: code:
|
# ¿ Aug 10, 2022 19:19 |
|
the naive way to do it would be to increment a marker variable while iterating through your list of items when that marker variable hits your intended batch size, send it, then reset and repeat until you finish your list I can throw up an example in a little bit There are more clever ways to do batching, but this will do what you need
|
# ¿ Mar 7, 2023 15:20 |
|
Secure strings are their own object type and you can read it from the user using Get-Credential
|
# ¿ Apr 21, 2023 21:15 |
|
Not powershell, but the report described here might tell you what you want: https://learn.microsoft.com/en-us/exchange/monitoring/mail-flow-reports/mfr-auto-forwarded-messages-report
|
# ¿ Jul 17, 2023 18:03 |
|
|
# ¿ May 14, 2024 03:27 |
|
Does Get-History not provide enough info? If you're wanting to get a log of commands run in a script, you can run Get-History | Export-CSV at the end of it and it should contain all of the info for commands run in that session.
|
# ¿ Apr 15, 2024 17:35 |