Quantcast
Channel: Exchange Server Development forum
Viewing all 7132 articles
Browse latest View live

SubscribeToPushNotificationsOnAllFolders for a specific mailbox

$
0
0

Is it possible to somehow provide a mailbox for which the  push notification is supposed to be received other than the user's account (used to generate the service) by which the method SubscribeToPushNotificationsOnAllFolders method had been called?

I am actually trying to read all the folders inside the group-mailbox for which the user is a member.

I was able to do it using SubscribeToPushNotifications method by supplying the all the folders to it. But it might not cater the situation where any folder had been created after the subscription is made.



Powershell C#- Loop through a csv file and take action

$
0
0

I am not a programmer, just trying to grab code from here and there to enable or disable skypeB users in bulk to make the job a bit easier and faster.

wrote the code below, but lines 41-43 are not working in the script. They work individually if I run them from the ps> prompt.

Any help will be appreciated. Script is still not completed do do other things as well. Hopefully when completed, I can post the final script here :?) don't pay any attention to the commented lines, that is just information to keep me calm...

#sAMAccountName,mail,msRTCSIPLine,ConferencingPolicy,RegistrarPool,LineURI,sipaddress,action

$UserList = Import-CSV "$PSScriptRoot\Skypebuserlist.csv"

#$category = "user"
#$name = "uid"
#$data = "sharifm*"
#$attributes = @("givenName", "mail", "manager")
#$attributes = @("mail","givenName","sn","msRTCSIP-Line","uid")
#$attribute ="givenName"

##$Header =  $attributes -join','
#Write-Host $Header
#$lines = @()
#$lines += $Header

#$results = @()

foreach ($user in $UserList) {
    Write-Host ("The User {0} with Phone ({1}) and Action = {2}" -f $user.sAMAccountName, $user.mail, $user.RegistrarPool, $user.sipaddress, $user.ConferencingPolicy, $user.msRTCSIPLine, $user.action)

    $poolName = (Get-CsUser | Group-Object RegistrarPool | sort-object count | select-object -first 1).Name

    if ($user.action -eq "disable")
    {
        Write-Host "disable account"
        Write-Host Get-CsUser $user.sAMAccountName
        if (Get-CsUser $user.sAMAccountName){
            disable-CsUser $user.sAMAccountName
        }
        else
        {
            Write-Host "not found"
        }
    }
    else
    {
        Write-Host ("Enable account for POOL {0} " -f $poolName)
        if ($user.msRTCSIPLine) {
            Write-Host "has phone"
          Enable-CsUser -Identity "$user.sAMAccountName" -RegistrarPool "$poolName" -SipAddress "sip:$user.sipaddress"
          Set-CsUser $user.sAMAccountName -EnterpriseVoiceEnabled $True -Confirm:$True
          Set-csuser $user.sAMAccountName -LineURI $user.msRTCSIPLine
                
        }
        else{
            Write-Host "does not have phone"
        }

    }
    Write-Host "-----------------------------------------------------------------------------"
}
Write-Host
Write-Host "File Done"
Write-Host

How can we know which calendar meeting is deleted from EWS managed api

$
0
0

I am using lastest version of EWS managed api and i am using extended property to set GUID for every meeting.

What i was trying to achieve was to look into delete items and get all GUIDs so that i can search into my database to find the matching GUID so that i can remove it from database.

So where i should look to get the cancelled meeting? and how can i search for them?

Is there any other way to know which meeting is cancelled.

difference between MAPI and EXTENDED MAPI

$
0
0

mapix.h header is part of the MAPI or Extended MAPI?

interfaces defined in the mapix.h use which DLL during run time?


[EWS] [E2013] Email with table and image is altered

$
0
0
I have been testing our software, which exports messages from Office 365 via EWS.  I have a test case of a message that is just a simple html table with a border, with some text and an image in the table.  The message looks fine in Outlook, but when viewed with OWA, the table border is gone, and the image is empty.  I then run the software, which obtains the message in MIME format.  Looking at the results confirms that the "Border" property of the table is missing, and the jpeg MIME part is a small, empty image.  But the message continues to be fine in Outlook.  This sure looks like a bug in Exchange/EWS somewhere.  Is there any place I can report this?  I have a .msg file that will demonstrate the problem.

How to get itemid of an occurence if the meeting when it is cancelled from EWS api

$
0
0

Normally when ever a meeting is cancelled i use moved eventtype to get olditemId using that i delete the cancelled meeting id´s from databse.

But for recurring meetings when a single occurence is cancelled only modified event is triggered. So i cant get olditemId. So in this scenario how can i idetify cancelled occurence.

Please Suggest some best and simple ways to deal with this problem.

I have one more doubt like how we get to know whether an user was internal user or external user from EWS.

Thanks in advance,

Rahul


ChangeType.delete never happens whilst delting appointment

$
0
0

Hi,

I am trying to make a EWS application  which will monitor any chnage,creation or deleted items. I am using synfolderitesm to get the the all changed appointments. change and create work fine, but it never gets deleted items. here is my code

public List<Appointment> GetChangedAppointments(SyncStateWrapper syncStateObject)
        {
            bool endOfChanges = false;  // Initialize the flag that will indicate when there are no more changes.
            ResponseModel result = null;             // Keeps the status of calling the API; [1=success, 0=non success]

            ChangeCollection<ItemChange> icc = null;
            List<Appointment> changedAppointmentsFromSiteMailBox = new List<Appointment>();

            try
            {
                endOfChanges = false;

                do  // Call SyncFolderItems repeatedly until no more changes are available.
                {

                    try
                    {
                        // Get a list of changes (up to MAX_CHANGES) that have occurred on normal items in the Inbox folder since the prior synchronization.
                        icc = service.SyncFolderItems(new FolderId(WellKnownFolderName.Calendar, syncStateObject.siteMailBox), PropertySet.FirstClassProperties,
                            null, MAX_CHANGES, SyncFolderItemsScope.NormalItems, syncStateObject.syncState);
                    }
                    catch (Exception e)
                    {
                        logger.Error("SyncFolderItems: " + e.Message + ": stack: " + e.StackTrace);
                    }


                    if (icc == null && icc.Count == 0)
                    {
                        logger.Info("There are no item changes to synchronize.");
                    }
                    else if (syncStateObject.syncState != null)
                    {
                        logger.Info("\n==== Retreiving Changed Appointments ====");
                        int i = 1;
                        Appointment changedAppointment = null;
                        foreach (ItemChange ic in icc)
                        {
                            logger.Info("\n - - Item " + i++);

                            if (ic.Item != null)
                            {
                                logger.Info("Subject: " + ic.Item.Subject);
                            }
                            logger.Info("ChangeType: " + ic.ChangeType.ToString());

                            if ((ic.ChangeType == ChangeType.Create) || (ic.ChangeType == ChangeType.Update))
                            {
                               //todo but works fine
                            }
                            else if (ic.ChangeType == ChangeType.Delete)
                            {
                                // ToDo: never comes here
                            }

does anyone know what can be the issue here? Please note here i am monitoring a room mailbox actually. so if any invitation in this mailbox if get cancelled  then i need to doa appropriate action.

Thanks

[EWS] Retrieving named property from calendar event

$
0
0

I am trying to use EWS to obtain named property 0x8580 (InetAcctName). I've tried various versions of ExtendedFieldURI but I either get an error about an invalid request, or nothing is returned. For example:

<t:ExtendedFieldURI DistinguishedPropertySetId="Common" PropertyId="0x8580" PropertyType="String" />

or

<t:ExtendedFieldURI PropertySetId="00062008-0000-0000-C000-000000000046" PropertyId="0x8580" PropertyType="String"/>

Can anybody clue me in on how to obtain this property?


Creating a in-place hold hold via EWS Managed API

$
0
0

I have successfully used the EWS Managed API to create an in-place hold.  However, when I view the hold on the compliance management tab/in-place eDiscovery and Hold page the status is "Search Not Started".  I have not been able to start the search via the API.  Is there a way to accomplish this?

If I open and save the hold in the web page it automatically starts and executes.  

This is the code I use to create the hold:

            string[] holdMailBoxes = new string[1];
            holdMailBoxes[0] = "/o=ExchangeLabs/ou=Exchange Administrative Group (FYD3SPDLT)/cn=Recipients/cn=6c6c2ff6a4784eb78afe611086613b7e-fake.name";
            SetHoldOnMailboxesParameters parameters = new SetHoldOnMailboxesParameters();
            parameters.HoldId = "Kevin Testing";
            parameters.ActionType = HoldAction.Create;
            parameters.InPlaceHoldIdentity = null;
            parameters.Query = "linux book";
            parameters.Mailboxes = holdMailBoxes;
            SetHoldOnMailboxesResponse holdResponse = CurrentService.SetHoldOnMailboxes(parameters );


Thank You

Getting null in e.MailItem.Message.CalendarPart in exchange transport agent

$
0
0

I am developing a custom transport agent for Exchange 2013. I am getting null in e.MailItem.Message.CalendarPart though I am sending a meeting request.

if (e.MailItem.Message.CalendarPart != null)
            {
                LocationProcessorStrategy.AddLocationInBody(e.MailItem.Message);
            }
            else
            {
                e.MailItem.Message.Subject += " [There is no calendar part - added by agent.]";
            }



atish

Need to help to Getting "Linked Master Account" value from Linked mailboxes programmatically by using C# EWS Managed API

$
0
0

Hi all

I need to get  "Linked Master Account" value  as figure below.


I try  programming for getting user information from linked mailbox. The code below  I follow  “.\Exchange 2013 101 Code Samples\Exchange 2013 Get user information programmatically”    This sample may be the same method as The article:Using Autodiscover to get user settings .   This sample is pretty easy to understand for a novice exchange developer.   

Mainly I highly need to get Linked Master Account value of each user in exchange server  in order to use it to proceed subsequent task in my C# coding. Unfortunately,  The  "Linked Master Account"  value was not returned from  this  code below  as expected.   The code show you below.

using System;
using System.Text;
using Microsoft.Exchange.WebServices.Autodiscover;
using System.Net;
using System.Collections.Generic;
namespace Exchange101
{
    // This sample is for demonstration purposes only. Before you run this sample, make sure that the code meets the coding requirements of your organization.
    class ExChangeGetUserInfo
    {
        static void Main(string[] args)
        {
            Console.Title = "EWS Test Console";

            AutodiscoverService autodiscover = new AutodiscoverService();

            string username_access="administrator";
            string password_access="**********";
            string domain_access="contoso";


            autodiscover.Credentials = new NetworkCredential(username_access,password_access ,domain_access);

            UserSettingName[] allSettings = (UserSettingName[])Enum.GetValues(typeof(UserSettingName));


            List<string> listEmail = new List<string>() { "john@contoso.com", "peter@contoso.com", "mice@contoso.com" };

                 Console.WriteLine("allSetting Email:" + allSettings.Length);
            foreach (string email in listEmail)
	{

                Console.WriteLine(string.Format("Email: {0} ",email));
		 GetUserSettingsResponse response = GetUserSettings(autodiscover,email, 10, allSettings);

            int count = 0;
            foreach (UserSettingName settingKey in response.Settings.Keys)
            {
                count = count + 1;
                Console.WriteLine(string.Format("{0} - {1}: {2}",count, settingKey, response.Settings[settingKey]));
            }
             Console.WriteLine(" complete.");
            Console.WriteLine("***************************************************************************************");
	}

            Console.WriteLine("\r\n");
            Console.WriteLine("Press or select Enter...");
            Console.ReadLine();
        }

        public static GetUserSettingsResponse GetUserSettings(
            AutodiscoverService service,
            string emailAddress,
            int maxHops,
            params UserSettingName[] settings)
        {
            Uri url = null;
            GetUserSettingsResponse response = null;

            for (int attempt = 0; attempt < maxHops; attempt++)
            {
                service.Url = url;
                service.EnableScpLookup = (attempt < 2);

                response = service.GetUserSettings(emailAddress, settings);

                if (response.ErrorCode == AutodiscoverErrorCode.RedirectAddress)
                {
                    url = new Uri(response.RedirectTarget);
                }
                else if (response.ErrorCode == AutodiscoverErrorCode.RedirectUrl)
                {
                    url = new Uri(response.RedirectTarget);
                }
                else
                {
                    return response;
                }
            }

            throw new Exception("No suitable Autodiscover endpoint was found.");
        }
    }
}

What is internal name for this attribute???.

I don’t sure whether or not this sample is achievable to my  requirement.  
Moreover , are there other ways to get this value ?

Please advise me
Thank you for your support.
Pongthorn



Is it possible to receive Plain Text Message Body

$
0
0

Greetings:

I'm developing a email processing service for my company, using a windows Service and Exchange Webservices. I need to only store the Plain Text of a email Body. When I use EmailMessage.Load () method I currently receive any xml tags as well as the text. is there a ptoperty available in EmailMessage or ExchangeService classes that provide a conversion selection.

thanks

What is the expiration time of a Streaming Subscription ID

$
0
0

I have an application that will subscribe to every mailbox for streaming notifications. Obviously in a large organization it will take some time to obtain all the Subscription ID's. I could optimize this by saving the Subscription ID's in a local database and, if the application is restarted, then re-subscribe with these cached ID's. 

I assume that after a period of time the cached ID will become stale and I must re-subscribe however I cannot find any documentation that describes the expiration time. Does any know what that time is?

Alan

list mailboxes in a migration batch

$
0
0

Hi all, 

I create migration batches (E2010 to E2013) by scripting and would need to list the mailboxes in them before starting the migration batch. 

get-migrationbatch | % {get-migrationuser -batchid $_ } 
and
get-migrationuser
do not return to-be-migrated-yet mailboxes.
In my specific case, I am working on a test env where i have not started any migration batch yet. I am trying to enumerate mailboxes in each and every migration batch I have created so far. Any hints? Thanks Michelangelo



How to get recccuring meeting ids using reccuringmaster id from ews

$
0
0

I have few questions i will number them please give me some suggestions on them

I use streaming notification for getting meeting details from exchange. When exchange sends itemId i querry exchange using that particularID to get meeting details for normal meeting and then i save it. But when coming to recurring meetings it just sends one Item ID which ReccuringmasterID i guess and when i use this ID to querry it just gives me one meeting.

Anyway all the meetings reccuring meetings have same data initially so its not a problem i can just save it into database.

1) But what i want was to get all the occurenceIDS by using this RecurringmasterID is it possibile in this way. I would greatly appriciate if you can me some example if there is way querry this

2) when a single occurence is cancelled i am getting modification event then i tried to querry using that ID but when i used IsCanceled method it is showing False. But why was a canceled meeting is showing false. if i just querry all the meetings again it is not there.

So how can i get information about canceled occurence.

Please give me suggestions, Thanks in advance

Is it Possible to Configure Default Contact List(People) by IT admin on Exchange or O365?

$
0
0
On Exchange server 2013 or o365, it is possible to
configure the default people list(contacts)?

Scenario is,

in the aspect of company and employess, it is much better if it is possible to
add their department's contact list(or some group) to each people contacts
view.

Is there any feature on Exchange server or o365 , IT Administarator can set the
each group's (or essential people contacts list) and apply to employees's
outlook ?

Thanks.

Exchange 2013 custom transport agent .dll issue

$
0
0

Exchange 2013 has several versions like

  1. Exchange 2013
  2. Exchange 2013 CU1
  3. Exchange 2013 CU2
  4. Exchange 2013 SP1 CU4
  5. and so on ....

If I copy .dll from Exchange 2013 CU1 and make my custom transport agent, then I can deploy it on Exchange 2013 CU1 only.

  1. Microsoft.Exchange.Data.Common.dll
  2. Microsoft.Exchange.Data.Transport.dll

It does not work in other versions like Exchange 2013 CU2, Exchange 2013 SP1 CU4 and etc. 

Is there any generic solution and which will work on all versions.


atish


The extended property attribute combination is Invalid

$
0
0

Hi,

we have hybrid exchange environment, exchange 2013 on-premises and exchange online.

I am importing archived email data to online archive mailbox using pst capture tool.

upload for a pst file complete with error "the extended property attribute combination is invalid" folder IPM_SubTree\Inbox

I got thousands of same error ,when I crosschecked error related emails ,those were not imported in the online archive.

those many emails skipped from upload.

could you please suggest on this.

how to fix the error so that complete pst file data is uploaded to the online archive mailbox?

we are using Exchange hybrid environment with Exchange 2013 SP3 On-premises.

We were using  Enterprise vault as email archiving solution.

pst files exported from enterprise vault console.

Settings are fine for the pst capture tool.

Thanks,

Megha

Exchange Server Deployment Support

$
0
0

Hi All,

We are planning to deploy Exchange 2016 (on-premise) in our organization and for that we are seeking microsoft support for deployment of the same + Microsoft 1 Year Exchange 2016 Support.

How can I get the quote of Support Cost for 1 Year for around 600 Users...

Kindly guide me...

Regards,

Nik

How to clone Exchange Email Message via EWS

$
0
0

Hi,

I have to "relay" an Exchange mailbox messages to an other mailbox with filtering rules , using EWS (web services).

The relayed (new) message must be identical to the original:

- same subject

- same body

- same attachements

- of course a different ItemId

I tried forward method : it don't keep the message as it is but add from,date and so at the top of body.

Is there a way to "clone" the message ?

Cheers

Viewing all 7132 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>