ITguy565
asked on
Powershell Scripting
Ladies and Gents,
I am looking to modify this script to add logic to it.
(The logic I would like to add would be a check)
To make sure that I have full mailbox rights prior to attempting the export mailbox command.
If FullAccess is found to be false then run the above command and make it true.
I need the logic statement listed above to be a challenge statement at the beginning of the script
Note the $user var at the top. This data will be pulled from an external source called test.txt
I am looking to modify this script to add logic to it.
$content = get-content "c:\test.txt"
foreach ($user in $content)
{export-mailbox $user -IncludeFolders "\Inbox","\Sent Items","\Deleted Items" -pstfolderpath c:\$user._Mailbox.pst}
(The logic I would like to add would be a check)
To make sure that I have full mailbox rights prior to attempting the export mailbox command.
add-mailboxpermission -Id “$user” -User “testadmin” -AccessRights FullAccess -Deny:$false
If FullAccess is found to be false then run the above command and make it true.
I need the logic statement listed above to be a challenge statement at the beginning of the script
Note the $user var at the top. This data will be pulled from an external source called test.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the fast reply, that was exactly what I needed.
ASKER