Get Calendar permissions for all users in a specific OU and output to CSV

Hi, got a exchange 2010 server, need to output this to migrate perms to o365
Get Calendar permissions for all users in a specific OU and output to CSV

Also need to do the same for send on behalf permissions for all users in specified and output to csv
LVL 3
ExchangeKBAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom CieslikIT EngineerCommented:
I don't know how to make CSV file but this script is making txt file with coma delimiter so you can easily import to Excel and save as CSV

$boxen = get-mailbox -Resultsize Unlimited
foreach ($box in $boxen) {
    $addresses = $box.EmailAddresses
    foreach ( $address in $addresses ) {
        [string]$ID = $address.AddressString
        write-host ID1 $ID
        $ID += ":\Calendar"
        $permissions = get-mailboxfolderpermission $ID
        write-host ID: $ID
        foreach ( $perm in $permissions ) {
            $mailbox = $address
            $granteduser = $perm.User
            $access = $perm.AccessRights
            $identity = $perm.Identity
            $valid = $perm.IsValid
            if ( $identity -ne "Anonymous" ) {
                $outstring = "$mailbox,$granteduser,$identity,$access,$valid`n"
                $output += $outstring
                write-host $outstring
            }
        }
    }
}
set-content C:\temp\out.txt $output

Open in new window


save it as permissions.ps1 and run in powershell

.\permissions.ps1
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alan CoxSr. Systems Engineer | Lead Microsoft CIE Qualified FacilitatorCommented:
Permissions do migrate if you use aad connect and hybrid which is the way I would migrate.
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.