Need to export a list of all room mailboxes from exchange that have AutoAccept turned on

Powershell script

Need to compile a list of all room mailboxes that have AutoAccept on. Attributes needed as follows

name, email, autoaccept (on or off), samaccountname, userprincipalname
ARM2009Asked:
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.

Will SzymkowskiSenior Solution ArchitectCommented:
Use the below script to get the results you are looking for...
$Log = "c:\resutls.csv"
$RoomMB = get-mailbox -ResultSize "unlimited" -RecipientTypeDetails "RoomMailbox"
ForEach ($MB in $RoomMB) 
    {
        $CalPro = Get-CalendarProcessing -Identity $MB.UserPrincipalName

        $Data = [ordered]@{
                    'Name'=$MB.Name;
                    'Email'=$MB.PrimarySmtpAddress.ToString();
                    'AutoProcessing'=$CalPro.AutomateProcessing;
                    'sAMAccountName'=$MB.samaccountname;
                    'UserPrincipalName'=$MB.UserPrincipalName;
               }

         $DataOut = New-Object -TypeName PSObject -Property $Data

         $DataOut | Export-Csv $Log -NTI -Append
        
}

Open in new window


That should be it.

Will.
ARM2009Author Commented:
had an error for missing }

added that before the last 2 line...

then errors below


[PS] C:\>.\conf.ps1
Missing closing '}' in statement block.
At C:\conf.ps1:17 char:49
+          $DataOut | Export-Csv $Log -NTI -Append <<<<
    + CategoryInfo          : ParserError: (CloseBraceToken:TokenId) [], ParseException
    + FullyQualifiedErrorId : MissingEndCurlyBrace

[PS] C:\>.\conf.ps1
Unable to find type [ordered]: make sure that the assembly containing this type is loaded.
At C:\conf.ps1:7 char:26
+         $Data = [ordered] <<<< @{
    + CategoryInfo          : InvalidOperation: (ordered:String) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Unable to find type [ordered]: make sure that the assembly containing this type is loaded.
At C:\conf.ps1:7 char:26
+         $Data = [ordered] <<<< @{
    + CategoryInfo          : InvalidOperation: (ordered:String) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound
ARM2009Author Commented:
this is what I can run in exchange...

Get-Mailbox -resultsize unlimited | Where {$_.ResourceType -eq "Room"} | Get-CalendarProcessing | ft identity, automateprocessing -AutoSize

and then I will have to sort for all autoaccept
Will SzymkowskiSenior Solution ArchitectCommented:
Make sure that you copy the entire script. change the "Export-csv $Log -NTI -Append" Change it to "Out-File $Log -Append".

I have tested this and worked completely fine.

Will.

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
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
Powershell

From novice to tech pro — start learning today.