Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




I need to find out how many AD users in a certain OU have extensionAttribute7 populated, and export this to a .csv file. I'm sure it'll start with Get-ADuser, but as a newb to this I'm having trouble fleshing out the rest. Can anyone help?

EDIT: The following gave me what I wanted, except from all of AD. Now trying to figure out how to get from just one OU

code:
Get-ADUser -filter * -properties extensionAttribute7 | Select-Object name, extensionAttribute7 | export-csv $dir$\ExAt7.csv -Encoding "Unicode"

TITTIEKISSER69 fucked around with this message at 19:19 on Jan 22, 2019

Adbot
ADBOT LOVES YOU

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




Thanks, I ended up doing it like this:

code:
Get-ADUser -filter * -properties extensionAttribute7 | where-object {$_ -like  "*OU=SubOUname*" } | Select-Object name, extensionAttribute7 | export-csv $dir$\ExAt7.csv -Encoding "Unicode"
EDIT: Crap, that just gave me everyone in the OU regardless of whether EA 7 is populated or not. Gonna try your way.

TITTIEKISSER69 fucked around with this message at 19:32 on Jan 22, 2019

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




Tried the full command and got "Missing an argument for parameter 'Filter'"

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




Yeah, I tried removing one then the other but still got errors.

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




code:
PS C:\Users\TK69> Get-ADUser -Filter {extensionAttribute7 -like "*"} -SearchBase "OU=Consultants,DC=redacted,DC=net" -properties extensionAttribute7 | Select-Object name, extensionAttribute7 | export-csv $redacted$\ExAt7.csv -Encoding "Unicode" -NoTypeInformation
Get-ADUser : Directory object not found
At line:1 char:1
+ Get-ADUser -Filter {extensionAttribute7 -like "*"} -SearchBase "OU=Consultants,D ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [Get-ADUser], ADIdentityNotFoundException
    + FullyQualifiedErrorId : Directory object not found,Microsoft.ActiveDirectory.Management.Commands.GetADUser

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




That was it, I had to change it to "OU=SubOU,OU=TopOU,DC=etc..."

Thanks!

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




Thanks all!

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




I need to figure out whose mailboxes are being forwarded to OldGuy, and instead forward them all to NewGuy. On-prem Exchange 2013. Where do I begin?

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




I have 50 security groups that I need to add 2 users to the Delivery Management list so they can send to all of them. They're all in the format companyname.office.cityname, is it possible to add user1@company.com and user2@company.com to the allowed senders for companyname.office.* ?

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




Submarine Sandpaper posted:

if I"m reading right:

Set-Mailbox -Identity "Robin Wood" -AcceptMessagesOnlyFrom "Lori Penor","Jeff Phillips" -AcceptMessagesOnlyFromDLMembers "Legal Team 1"

https://docs.microsoft.com/en-us/exchange/recipients/user-mailboxes/message-delivery-restrictions?view=exchserver-2019

I'm thinking it would be more like the example linked here: https://community.spiceworks.com/topic/2232835-remove-member-from-delivery-management-with-exhange-powershell

quote:

Set-DistributionGroup "GROUP-NAME-HERE" -AcceptMessagesOnlyFromSendersOrMembers((Get-DistributionGroup "GROUP-NAME-HERE").AcceptMessagesOnlyFromSendersOrMembers + "IDENTITY-OF-USER-OR-GROUP-HERE")

The trick is I'm hoping I can literally enter companyname.office.* so all of the groups can be updated at once.

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




What command can I use to generate a list of mailboxes that one employee has Send As permission on?

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




That's showing me FullAccess, but not Send As

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




code:
PS C:\Users\TK69> Get-Mailbox | Get-RecipientPermission -Trustee USERNAME
Get-RecipientPermission : The term 'Get-RecipientPermission' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.
At line:1 char:15
+ Get-Mailbox | Get-RecipientPermission -Trustee USERNAME
+               ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-RecipientPermission:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




My bad, I should have stated that up front

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




(Names changed) We've had a couple of promotions/title changes and now "Barney" is no longer the Manager (in AD) for a bunch of people, instead "Jenny" is. Is it possible to use PS to change all of these people's Manager field to Jenny? They're all in the same OU.

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




Thank you both! For the initial question I took a second look and saw it was only ten users that needed updating, so I got those done by hand. However this will help with other OUs full of users that need updating.

Question: how do I filter the users by their job title? Some titles report to Manager A while some report to Manager B, etc.

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




I need to determine which mailboxes (of disabled users) are forwarding to oldmanager, and then either turn off the forwarding or change it to newmanager - which one of those it will be is TBD. This is on-prem Exchange 2016, how do I begin?

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




I've got a user who is getting emails sent to dynamic distribution groups of which she is not a member - I exported the memberships of the three groups to CSV files and she isn't on any of them.

My hunch is that a former employee is still on one of these lists and their mailbox is forwarding to her. What PS command can I run to see what mailboxes have forwarding enabled to her?

EDIT: This is in Exchange Online

TITTIEKISSER69 fucked around with this message at 23:28 on Jul 10, 2023

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




Afraid not, as the sender put the dynamic distro groups' addresses in BCC.

Adbot
ADBOT LOVES YOU

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




TITTIEKISSER69 posted:

I've got a user who is getting emails sent to dynamic distribution groups of which she is not a member - I exported the memberships of the three groups to CSV files and she isn't on any of them.

My hunch is that a former employee is still on one of these lists and their mailbox is forwarding to her. What PS command can I run to see what mailboxes have forwarding enabled to her?

EDIT: This is in Exchange Online

Any ideas?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply