none
Create Offline Address Book using powershell - PublicFolderDistributionEnabled not found RRS feed

  • General discussion

  • We are using the following commands to create a new Offline Address book using powershell. The command New-OfflineAddressBook runs successfully and creates an Offline Address Book. However when we try to set the value of PublicFolderDistributionEnabled property using Set-OfflineAddressBook we get the following exception

    Remote Exception: A parameter cannot be found that matches parameter name 'PublicFolderDistributionEnabled'

                try

                {

                    using (Runspace runSpace = OpenRunspace())
                    {
                        // Create offline address book command
                        var command = new Command("New-OfflineAddressBook");
                        command.Parameters.Add("Name", name);
                        command.Parameters.Add("AddressLists", addressListName);
                        command.Parameters.Add("VirtualDirectories", OABServer);

                        // Execute command
                        if ((res = ExecuteShellCommand(runSpace, command)) == false)
                            return false;

                        // Set offline address book command
                        var command1 = new Command("Set-OfflineAddressBook");
                        command1.Parameters.Add("Identity", name);
                        command1.Parameters.Add("PublicFolderDistributionEnabled", publicFolderEnabled);
                        command1.Parameters.Add("Confirm", new SwitchParameter(false));

                        // Execute command
                        if ((res = ExecuteShellCommand(runSpace, command1)) == false)
                        {
                            DeleteOfflineAddressBook(name);
                            return false;
                        }
                    }
                }
                catch (Exception ex)
                {
                    DeleteOfflineAddressBook(name);
                    throw;
                }


    Thursday, September 4, 2014 12:53 PM

All replies