none
Public Folder Send As Permissions RRS feed

  • Question

  • I'm trying to modify a script I found but i get an error: Cannot bind argument to parameter 'Identity' because it is null. Can someone please take a look at the below script and help me fix it?

    FYI, i already have a list of all mail-enabled CN names in the format: CN=TEST-PF,CN=Microsoft Exchange System Objects,DC=conedison,DC=net

    My environment: Exchange 2010 SP3 RU24

    ======================================================

    $folderlist = "\\EX10UTIL\C$\TestScripts\PF\Input\DistinguishedName-One-Folder.txt"
    $folders = get-content $folderlist
    Import-Module ActiveDirectory

    ForEach ($folder in $folders) {
      
     $ADobjects = Get-ADObject -Identity $folders |

     ForEach ($ADobject in $ADobjects) {

        Get-ADPermission $ADobject.distinguishedName |
           Where {$ADobject.ExtendedRights -like '*Send-As*' -and $ADobject.User.ToString() -ne 'CONED\Exchange SendAs Services'} | Select Identity,User

     }  | Export-Csv \\EX10UTIL\C$\TestScripts\PF\Reports\SendAs-Perm-For-Mail-Enabled-PFs.csv -NoTypeInformation
    }


    Piotr


    • Edited by Piotr332211 Sunday, February 24, 2019 2:43 AM
    • Moved by Bill_Stewart Wednesday, September 4, 2019 6:01 PM This is not "fix/debug/rewrite script for me" forum
    Sunday, February 24, 2019 2:43 AM

All replies

  • We cannot help you with scripts you have "found" on the Internet.  The forum is dedicated to techs who are writing scripts and know how to write scripts.  Please ask the author of the script for help.

    You also need to understand enough about scripting to be able to read error messages

    "Cannot bind argument to parameter 'Identity' because it is null"

    This is pretty explicit.  The value does not exist.

    Please learn enough PowerShell to understand how to read and understand error messages.  They are very exact in their information.  Lack of any technical knowledge of Windows and PowerShell will make using any script impossible. We cannot teach you PowerShell.

          Microsoft Virtual     Academy - Getting Started with Microsoft PowerShell


    \_(ツ)_/

    Sunday, February 24, 2019 3:11 AM