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

access to my Office 365 third-party app for external user : “a User account is not registered for the account”

$
0
0

In my third-party web application of Office 365, I want to have access to the contacts, events and emails of all the users from the organizations who installed my app. The thing is I don't want that all these users have to grant me access, I just want one admin of the org to grant access for my app and then be able to retrieve the data I need for all the users.

To test for one organization, I logged in as the admin and proceed to the Oauth2 authentication to retrieve the access token and in the first request (the GET one to retrieve an authorization code) i add the parameterprompt=admin_consent.

With this access token, I can access the data (emails, contact, event) of the admin

for instance for the contacts

uri: https://outlook.office365.com/ews/odata/Users(adminemail)/Contacts

but not the data of the other users of this org with this uri

uri: https://outlook.office365.com/ews/odata/Users(useremail)/Contacts

The only thing I can do is retrieve an access token for each user but it supposed that each user has to authorize the access to the app but it's very cumbersome. So, i don't see what enables the parameter prompt=admin_consent and how to use it. Does anybody know what it does?

And my question is: how can I do to access the data of all the users of one organization when the access has been granted by one admin?

Thank you!


parsing InternetMessageHeaders via EWS

$
0
0

I have some generic mailboxes in my Exchange 2010 environment that have a number of smtp addresses assigned to them.  I would like to write a script to parse the emails in these generic mailboxes and grab the smtp address that the email was sent to. I can do this manually by opening the email in outlook and looking at the Internet Message Header, the 'To' field shows the specific smtp address the email was addressed to.  When I connect to the mailboxes via EWS and parse the InternetMessageHeader of the email, I can see all the values except for the 'from' and 'to' fields.  

The ToRecipients property of the email itself won't work for me as it simply shows the primary smtp address of the mailbox.  

Error when trying to search for folders within an Exchange server

$
0
0

I am working on an existing application that searches folder within an exchange server in asp.net C#

The code is very basic is like this 

FolderView view = new FolderView(int.MaxValue);
            view.PropertySet = new PropertySet(BasePropertySet.IdOnly);
            view.PropertySet.Add(FolderSchema.DisplayName);
            view.PropertySet.Add(FolderSchema.FolderClass);
            view.PropertySet.Add(FolderSchema.ParentFolderId);
            view.Traversal = FolderTraversal.Deep;

            FindFoldersResults findFolderResults = service.FindFolders(new FolderId(WellKnownFolderName.Root, mailbox), view);

This code has been working on another Exchange server before.

However when I try to change the exchange server I try to scan I get an error like this :

Microsoft.Exchange.WebServices.Data.ServiceVersionException: Exchange Server doesn't support the requested version.
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ProcessWebException(WebException webException)
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest& request)
   at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute()
   at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
   at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalFindFolders(IEnumerable`1 parentFolderIds, SearchFilter searchFilter, FolderView view, ServiceErrorHandling errorHandlingMode)
   at Microsoft.Exchange.WebServices.Data.ExchangeService.FindFolders(FolderId parentFolderId, FolderView view)
   at ExchangeSyncService.ExchangeToSqlService.SyncFolderForSubUser(ExchangeService service, Mailbox mailbox, Int32 nUserID)

The Exchange server that succeeded and failed are both Exchange 2010.  I am searching are both Exchange 2010, and I checked the documentation that FindFolder is supported by all versions of Exchange 2010. 

Is it really a version error or something else? Anyone have any insight on this?


Outlook 2010 mail creating error

$
0
0

I have exchange server 2010 and my client is windows 7 and when I tried to set up a new email for the client, I got this errors

I have done many things such as:

1. I deleted all the outlook files in the client profile and I tried to set up the outlook again --- no vain

2. I restarted the exchange server 2010 and all the services including RPC service and replication-- no vain

3. I tried to disable the mail from exchange console and rebuilt it again --no vain

4. I checked the ADSI of this user and try to copy and paste the attribute "ShowInAddressBook"of active user to this user -- no vain

5. I formatted the PC of the client --N0 vain

Can you please help me to solve this problem as soon as possible?????

[E2013][C#][Windows]: Encountered an internal error in the SSL library

$
0
0

Scenario - 

I'm developing a .Net 4.0 based application on Window 7. It simply Enable-Mailbox for particular user over remote Exchange Server 2013.

ES 2013 is installed on Windows Server 2012. PowerShell v4.0 is installed on both development and remote server.

The following is the code snippet for same - 

// Global variables
const string ShellUri = "http://schemas.microsoft.com/powershell/Microsoft.Exchange";

        // URL for remote powershell
        const string ExchangeServerUri = " https://ExchangeServer.domain.com/powershell";

        const string ComputerName = "ExchangeServer.domain.com";
        const int Port = 5985; // If SSL=true then 5986
        const string ApplicationName = @"/wsman";
        const string Identity = "pabdul@domain.com";
        const string Database = "some db";
        const string DomainController = "XX.domain.com";

        // For credentials
        const string AdminUser = @"DOMAIN\Administrator";
        const string PlainPass = "password";

// PSCredential object
public PSCredential Credential
        {
            get
            {
                var password = ConvertToSecureString(PlainPass);
                var psCredential = new PSCredential(AdminUser, password);

                return psCredential;
            }
        }

// Function for enabling mailbox
private void EnableMailBoxNew()
        {
            object psSessionConnection = null;

            // 1. Create WSManConnectionInfo
            var wsManConInfo = new WSManConnectionInfo((new Uri(ExchangeServerUri)), ShellUri, Credential);
            wsManConInfo.AuthenticationMechanism = AuthenticationMechanism.Kerberos; 
            wsManConInfo.AppName = ApplicationName;
            wsManConInfo.Port = Port;
            wsManConInfo.UseCompression = true;

            // 2. Create runspace
            var runspace = RunspaceFactory.CreateRunspace(wsManConInfo);

            using (var powershell = PowerShell.Create())
            {
                // New-PSSession command
                var command = new PSCommand();
                command.AddCommand("New-PSSession");
                command.AddParameter("ConfigurationName", "Microsoft.Exchange");
                command.AddParameter("ConnectionUri", new Uri(ExchangeServerUri));
                command.AddParameter("Credential", Credential);
                command.AddParameter("Authentication", "Basic");

                PSSessionOption sessionOption = new PSSessionOption
                {
                    SkipCACheck = true,
                    SkipCNCheck = true,
                    SkipRevocationCheck = true
                };
                command.AddParameter("SessionOption", sessionOption);

                // Enable mailbox command
                //var cmdEnableMailbox = new Command("Enable-Mailbox");
                //cmdEnableMailbox.Parameters.Add("Identity", Identity);
                //cmdEnableMailbox.Parameters.Add("Database", Database);
                //cmdEnableMailbox.Parameters.Add("DomainController", DomainController);

                //powershell.Commands.AddCommand(cmdEnableMailbox);
                //powershell.Runspace = runspace;
                //var result = powershell.Invoke();

                powershell.Commands.Clear();
                powershell.Commands = command;
                runspace.Open(); // Open remote runspace
                powershell.Runspace = runspace; // Associate runspace with powershell
                var result = powershell.Invoke();

                if (result != null && result.Count > 0)
                {
                    psSessionConnection = result[0];

                    powershell.Commands = command;
                    powershell.Runspace = runspace;
                }
                else
                {
                    MessageBox.Show("New-PSSession is null! Can't proceed further.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            // Import remote exchange session into runspace
            if (psSessionConnection == null) return;

            // 3. Set ExecutionPolicy on the process to unrestricted
            using (var powershell = PowerShell.Create())
            {
                var command = new PSCommand();
                command.AddCommand("Set-ExecutionPolicy");
                command.AddParameter("Scope", "Process");
                command.AddParameter("ExecutionPolicy", "Unrestricted");
                powershell.Commands = command;
                powershell.Runspace = runspace;

                powershell.Invoke();
            }

            // 4. Import session object to runspace
            using (var powershell = PowerShell.Create())
            {
                var command = new PSCommand();
                command.AddCommand("Import-PSSession");
                command.AddParameter("Session", psSessionConnection);
                powershell.Commands = command;
                powershell.Runspace = runspace;

                powershell.Invoke();
            }

            // 5. Now execute your complex queries
        }

Now on execution I am facing problem of Encountered an internal error in SSL library.

Could anyone suggest why I am being getting so error?


Vikram Singh Saini (Freelancer on Elance)


Where can I find the url address for my microsoft exchange server?

$
0
0

Hi,

I am unable to find the url address for my microsoft exchange server.

It will be greatly appreciated if someone could help me finding the server address.

Thanks

In Failover Cluster 2008 mailbox2 server network status Unavailable (down).

$
0
0

Hi 

I am new here, & hope i can get some help for the below issue

let me keep it simple scenario 

i have 2 mailbox server ( mbx01 & mbx02)

2 cashub Server ( cshb1-cshb2) all running on hyper-v. last week due to some maintenance in data center i have to bring down all the production environment, once the thing are fixed in DC , i started all the server and found out that my exchange node 2 database are failed.

In exchange 2010 failover cluster node ( node2 ) is down network status unavailable. due to by exchange node2 database are failed.

also i cannot access the file share witness directory from any of the above server.

can any body assist me on this please 

thank you 

Exchange 2010 updating recurring meetings

$
0
0

Using Exchange 2010 and a variety of Outlook clients, usually 2007 or 2010.  When a recurring meeting's attendees, title, or contents are  updated, and the organizer sends updates to new or all recipients, the selected recipients receive 2 notices:

  • 1 for the series
  • 1 for the next meeting in the series

Is there any way to prevent the second notification?


Exchange 2010 SP1 hosting /powershell/ not showing all commands

$
0
0

Hi,,

I have a Exchange 2010 SP1 /hosting setup in place and I'm now trying to build some simple provisioning in C# to, for example, create an organization.

 

  string str_password = "#######";
  string username = "Administrator@contoso.com";
  SecureString password = new SecureString();

  string liveIdconnectionUri = "http://e2010-cashub01/Powershell?serializationLevel=Full";

  foreach (char x in str_password)
  {
   password.AppendChar(x);
  }

  PSCredential credential = new PSCredential(username, password);

  // Set the connection Info
  WSManConnectionInfo connectionInfo = new WSManConnectionInfo((new Uri(liveIdconnectionUri)), "http://schemas.microsoft.com/powershell/Microsoft.Exchange",
  credential);

  connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Kerberos;

  Runspace runspace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(connectionInfo);
  RunspaceConfiguration runspaceConf = RunspaceConfiguration.Create();

  PowerShell powershell = PowerShell.Create();
  PSCommand command = new PSCommand();

  command.AddCommand("get-command");

 

This piece of code works fine, I see the commands available to me:

 

Exit-PSSession
Get-Command
Get-FormatData
Get-Help
Get-Mailbox
Get-MailboxExportRequest
Get-MailboxExportRequestStatistics
Get-MailboxImportRequest
Get-MailboxImportRequestStatistics
Measure-Object
New-MailboxExportRequest
New-MailboxImportRequest
Out-Default
Remove-MailboxExportRequest
Remove-MailboxImportRequest
Resume-MailboxExportRequest
Resume-MailboxImportRequest
Search-Mailbox
Select-Object
Set-ADServerSettings
Set-MailboxExportRequest
Set-MailboxImportRequest
Suspend-MailboxExportRequest
Suspend-MailboxImportRequest
Write-AdminAuditLog

 

The funny thing is, that I cannot see commands like create-mailbox, create-organization, etc. I'm probably just missing something here, but I'm stuck. When I start a EMS it works fine. I have all the commands I need to build my provisioning scripts. Anybody any idea?

Any help would be greatly appreciated...


Scan the mailbox Content using the exchange powershell commands (need urgent info)

$
0
0

hi,

 

Is there any way where in i can scan the mail content of each mailbox user and classify that these no of voice or video or text messages are there in user inbox using the powershell.

 

My requirement

1) is to collect the voice , video, text etc... messages for inbox of each exchange user. Is there any command that gives the type of message, text, voice, video, etc.?

2) I am an administrator and i want to monitor the mailbox users and there content .Do we know whether ,this requires a login into the individual mailbox with the user credentials?

 

Please reply me @ vs_subrahmanyam@hotmail.com

 

Advanced thanks for your help...

 

Thanks

Shiva

Office 365 hybrid with msdn premium

$
0
0

We are trying to creating a hybrid exchange setup for our development testing purpose.

I have few doubts,

1. I'm using office365 account i got using my msdn premium account.

    Is it possible to use this account for hybrid exchange setup ? I see some restrictions like mailbox creations are limited in office365 i got using msdn premium, Is that so ? Is there any restrictions in office365 account got from MSDN premium?

2. Is there any plan in which i can get more users license say 1000 users for development and testing.

Exchange 2010 SP3 Rollup Update 6

$
0
0

Our Exchange environment is currently on Exchange 2010 SP3 RU3 and the Forefront Protection 2010 for Exchange server version is 11.0.713.0 (Rollup 3). 

We planning to upgrade Exchange servers and install Exchange 2010 SP3 RU6, question which I have is it Mandatory to upgrade the Forefront Protection 2010 for Exchange server version is 11.0.727.0 (Rollup 4) before we install Exchange 2010 SP3 RU6 on the Exchange servers.

Thanks,

AJ

Exchange 2010 - Need a script to remove all meetings owned by a specific user

$
0
0

Hi everybody, I don't have experience with exchange scripting nor powershell so I'm looking for some help.

The tast I need is to find and remove all meetings owned by a specific user. For example, when an employee is no longer with the company I need a way to search and remove all their meetings from conference rooms, etc.

Let me know if you need any other info:

* Exchange 2010 SP1

* Windows server 2008

* Find and remove all meetings owned by a specific user on either a specific mailbox or all room type mailboxes


MCSA:Security CCNA

AD distribution group not in Outlook

$
0
0

I have created several distribution groups into Active Directory.
Those group don't show in the Outlook.
Should I set more properties to the groups or ?

[E2010] [EWSMA] [C#] [Windows]: Determine if meeting was sent by delegate

$
0
0
If I retrieve an appointment/meeting item using the EWSMA is there any way to tell if it was sent by a delegate? In Outlook the meeting request would show as being sent by "Delegate on behalf of Organizer", but the Organizer property of the Appointment item only contains the "Organizer" email address - is there a property somewhere that will show the "Delegate"?

PidLidAllAttendeesString contains unchecked resources from SchedulingAssistant in Exchange 2013

$
0
0

We are impersonating rooms calender to find all appointments and then we book mapped resources in our own system. Now to access the resources that organizer has choosen while creating a meeting we refer to PIDLIDAllAttendeeString. Appointment.Resources is null in this case since organizer created this appointment and from Rooms calender we cannot access this property. Even EWS editor returns resources as Blank for appointments.

                 Object allAttendees = null;
                ExtendedPropertyDefinition prop = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x8238, MapiPropertyType.String);
                appointment.TryGetProperty(prop, out allAttendees);

Now we are getting a strange behaviour. Lets say organizer added Room1 from SchedulingAssistance. Unchecked send meeting to this attendee checkbox and added Room2 as well. Room1 calender will get booked but room2 calender won't get booked.

While reading this property we get Room1,Room2 and based on this we get unexpected behaviour in our system. IS this by design?

Are there any other extended property that can provide this information?

Thanks and Regards

Rohit

[E2010] [EWS] [C#] [Windows]: Testing connection before calling FindItems

$
0
0

Hello,

I read somewhere that when you call the FindItems method, that it opens and closes the connection for you. Is there a way to verify that the exchange server(s) are up and ready to respond to calls before calling that method?

I have a simple service that manages a mailbox, and there was maintenance done last night, which resulted in a bunch of connection errors, so I want to try and avoid this, without having to stop the service during maintenance.


If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.

Don't Retire Technet

[E2010][EWSMA] [C#][Windows8.1]Is there a bug which prevents returning extended property types NUMBER and CURRENCY?

$
0
0

I can return strings from extended properties, but no numbers/currency. Am I missing something or is this a bug? Any help would be greatly appreciated. I have found other similar questions going back 4 years with no resolutions. Closest example is here:

http://social.msdn.microsoft.com/Forums/exchange/en-US/75dc2a5e-4d9f-4271-a15c-46e7cbd57b24/e2010-ewsma-c-extended-property-request-of-type-currency-is-not-returned?forum=exchangesvrdevelopment

Sample Code:

       ExtendedPropertyDefinition ExtProp_PFamCode = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "ProductFamilyCode", MapiPropertyType.String);
        ExtendedPropertyDefinition ExtProp_RevPot = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "RevenuePotential", MapiPropertyType.Currency);
        ExtendedPropertyDefinition[] userFields = new ExtendedPropertyDefinition[] { ExtProp_BU, ExtProp_ReqTask, ExtProp_ProjName, ExtProp_ProcStage, ExtProp_RevPot, ExtProp_PFamCode };

        PropertySet propset = new PropertySet(BasePropertySet.FirstClassProperties, userFields);

        var iv = new ItemView(1000);
        FindItemsResults<Item> searchResult = null;
        do //I think this will loop 1000 at a time which is excellent.
        {
            searchResult = service.FindItems(HITFolder.Id, filter, iv);
            foreach (var t1 in searchResult.Items)
            {
                DataRow nr = dt_Results.NewRow();
                t1.Load(propset);

                object obj_BU = null, obj_PStage = null, obj_ProjName = null, obj_ReqTask = null, obj_RevPot = null, obj_PFamCode = null;

                Task t = (Task)t1;


                foreach (ExtendedProperty extendedProperty in t.ExtendedProperties)
                {
                    if (extendedProperty.Value != null)
                    {
                        if (extendedProperty.PropertyDefinition.Name == "RevenuePotential")
                        {
                        string ExtendedPropertyName = extendedProperty.PropertyDefinition.Name;
                        string ExtendedPropertyValue = extendedProperty.Value.ToString();
                        }
                    }
                }

In this example RevenuePotential is always null. I have tried both currency and number type custom fields.

Thank you,

Disk space question

$
0
0

I have physical Exchange Server 2007 SP3 running on Windows Sever 2003 all latest updates. Its a ccr cluster. Have two mbx server and one client, hub transport server.

It has 900 gb raid 5 disk space for MBX. Running out of disk space.

My question is, is it ok if I bring one the cluster node down for maintenance and swap the four disks 250gb to a higher capacity like 500gb create a new volume and give a drive letter exactly same as current and turn the server on then reseed the passive node that has more disk space now, then failover and upgrade the disk space on the 2nd node?

Am I going to run in to any problem? Please let me know. If anyone has experience.

Sandeep

EWS 2010 Managed API Cannot delete email if scheduled via extended properties

$
0
0

I  have code that schedules an email as below:

Scheduling Code:

 _ExchangeService.Credentials = new WebCredentials(_UserName, _Encrypt.getEncryptedValue(),_Domain);
_ExchangeService.AutodiscoverUrl("somemailbox@somedomain.com");
   
            
            this.ScheduleRequest = bAddScheduling;

  try
                {
                    EmailMessage message = new EmailMessage(_ExchangeService);

    //set message properties

   //add scheduling     

    message.SetExtendedProperty(PR_DEFERRED_SEND_TIME, ut);

            message.SetExtendedProperty(PR_DEFERRED_DELIVERY_TIME, ut);

if(bAddScheduling)

{  

  message.Save(WellKnownFolderName.Outbox);

}

message.SendAndSaveCopy();

}

Delete Code:

    ItemId id = new ItemId(ID);

            EmailMessage current =  EmailMessage.Bind(_ExchangeService, id);

            try

            {
                
                current.Delete(DeleteMode.HardDelete);
            }
            catch (Exception e)
            {
                throw e;
                //string ex = e.ToString();
                //_COMPlusExceptionCode = -532462766
                //[Microsoft.Exchange.WebServices.Data.ServiceResponseException] = {"Object cannot be deleted."}

            }
        }

Scheduling seems to be working just fine.  My problem is that I want to enable the deletion of a scheduled email and when I try to delete I receive "Microsoft.Exchange.WebServices.Data.ServiceResponseException: Object cannot be deleted."  If I just save the email and do not send it I can delete it programatically.  If I make a call to Send or SendAndSaveCopy after saving the message I always receive the object cannot be deleted message.  I can log into the mailbox as the service account and delete it just fine.  I am stumped please help.  

Viewing all 7132 articles
Browse latest View live


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